mirror of
https://github.com/holidayapi/holidayapi-node.git
synced 2025-06-21 12:36:33 +00:00
33 lines
569 B
Markdown
33 lines
569 B
Markdown
# node-holidayapi
|
|
Official Node.js library for [Holiday API](https://holidayapi.com)
|
|
|
|
## Installation
|
|
|
|
```shell
|
|
npm install --save node-holidayapi
|
|
```
|
|
|
|
## Usage
|
|
|
|
```javascript
|
|
var HolidayAPI = require('node-holidayapi');
|
|
var hapi = new HolidayAPI('_YOUR_API_KEY').v1;
|
|
|
|
var parameters = {
|
|
// Required
|
|
country: 'US',
|
|
year: 2016,
|
|
// Optional
|
|
// month: 7,
|
|
// day: 4,
|
|
// previous true,
|
|
// upcoming true,
|
|
// public: true,
|
|
// pretty: true,
|
|
};
|
|
|
|
var hapi.holidays(parameters, function (err, data) {
|
|
// Insert awesome code here...
|
|
});
|
|
```
|
|
|