2.0.0 • Published 5 years ago

dackel v2.0.0

Weekly downloads
9
License
MIT
Repository
github
Last release
5 years ago

dackel

Fetches data from any API in intervals

Build Status Known Vulnerabilities codecov

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 poll
  • options Object (optional) - interval in ms + request-module options
  • callback Function (required) - Recieves http-response

Development

$ npm test

Changelog

  • 1.1.0
    • Fixed exposure
  • 1.0.0
    • Initial release
2.0.0

5 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago