UNPKG

@repetere/node-holidayapi

Version:

Node.js library for Holiday API

98 lines (59 loc) 2.95 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Home</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Home</h1> <h3> </h3> <section> <article><h1>node-holidayapi</h1><p><a href="https://coveralls.io/github/repetere/node-holidayapi?branch=master"><img src="https://coveralls.io/repos/github/repetere/node-holidayapi/badge.svg?branch=master" alt="Coverage Status"></a> <a href="https://travis-ci.org/repetere/node-holidayapi"><img src="https://travis-ci.org/repetere/node-holidayapi.svg?branch=master" alt="Build Status"></a></p> <p>Node.js library for <a href="https://holidayapi.com">Holiday API</a></p> <h2>Installation</h2><pre class="prettyprint source lang-shell"><code>npm install --save @repetere/node-holidayapi</code></pre><h2>Usage</h2><pre class="prettyprint source lang-javascript"><code>const HolidayAPI = require('node-holidayapi'); const hapi = new HolidayAPI('_YOUR_API_KEY_').v1; const parameters = { // Required country: 'US', year: 2016, // Optional // month: 7, // day: 4, // previous: true, // upcoming: true, // public: true, // pretty: true, }; hapi.holidays(parameters) .then(data=>{ // Insert awesome code here... }) .catch(error=>{ //handle errors });</code></pre><h3>Development</h3><p><em>Make sure you have grunt installed</em></p> <pre class="prettyprint source lang-sh"><code>$ npm i -g grunt-cli jsdoc-to-markdown</code></pre><p>For generating documentation</p> <pre class="prettyprint source lang-sh"><code>$ grunt doc $ jsdoc2md index.js > docs/api.md</code></pre><h3>Testing</h3><pre class="prettyprint source lang-sh"><code>$ npm i $ grunt test</code></pre><h3>Contributing</h3><p>Fork, write tests and create a pull request!</p> <h3>Notes</h3><p>Check out <a href="https://github.com/repetere/node-holidayapi/blob/master/docs/api.md">https://github.com/repetere/node-holidayapi/blob/master/docs/api.md</a> for the full node holiday api Documentation</p></article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="HolidayAPI.html">HolidayAPI</a></li></ul><h3>Global</h3><ul><li><a href="global.html#holidays">holidays</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Jun 25 2018 22:51:02 GMT-0400 (EDT) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>