Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

obi-jan-kenobi/dackel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  • 2.0.0
    • Updated deps
  • 1.1.0
    • Fixed exposure
  • 1.0.0
    • Initial release

About

Fetches data from any API in intervals

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published