dackel
v2.0.0
Published
Fetches from APIs in intervals
Downloads
14
Readme
dackel
Fetches data from any API in intervals
Table of contents
Installation
$ npm install --save dackel
$ yarn add dackel
Usage
const subscribe = require('dackel')
// logs the user-data every 10000ms to the console
const unsubscribe = subscribe('https://api.github.com/users/obi-jan-kenobi',
{
interval: 10000,
headers: {
'User-Agent': 'dackel'
}
},
(err, response, user) => console.log(user))
// stops polling
unsubscribe()
API
dackel(url, options, callback) -> function
url
String (required) - url to polloptions
Object (optional) - interval in ms + request-module optionscallback
Function (required) - Recieves http-response
Development
$ npm test
Changelog
- 1.1.0
- Fixed exposure
- 1.0.0
- Initial release