ticker-stream

0.1.1 • Public • Published

node-ticker-stream

Simple example

const TickerStream = require('ticker-stream');

const ticker = new TickerStream();
ticker.on('data', function(data) {
  console.log(data);
});

/*
{ key: 3398 }
{ key: 1078 }
{ key: 603 }
 :
*/

Optional arguments

const TickerStream = require('ticker-stream');

var i = 0;
const ticker = new TickerStream({
  min: 10,
  max: 500,
  duration: 2000,
  phony: () => {
    return {
      id: ++i,
      time: Date.now()
    };
  }
});
ticker.on('data', function(data) {
  console.log(data);
});

/*
{ id: 1, time: 1475400789052 }
{ id: 2, time: 1475400789076 }
{ id: 3, time: 1475400789472 }
  :
*/

Readme

Keywords

Package Sidebar

Install

npm i ticker-stream

Weekly Downloads

1

Version

0.1.1

License

MIT

Last publish

Collaborators

  • ryo0301