dackel

2.0.0 • Public • Published

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

/dackel/

    Package Sidebar

    Install

    npm i dackel

    Weekly Downloads

    1

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    4.59 kB

    Total Files

    7

    Last publish

    Collaborators

    • obi-jan-kenobi