Skip to content

gobengo/stream-cycle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stream-cycle

Create a stream/Readable that infinitely cycles over the items in an array or another, finite Readable. A lot like Python's itertools.cycle

One use case for this is to produce an infinite stream from an Array of mock objects so you can test downstream Writables.

Example

var alternating = cycle([1,0]);
alternating.on('data', console.log);
// 1
// 0
// 1
// 0
// 1
// 0

make commands

  • make build - will npm install and bower install
  • make dist - will use r.js optimizer to compile the source, UMD wrap, and place that and source maps in dist/
  • make clean
  • make server - serve the repo over http
  • make deploy [env={*prod,uat,qa}] - Deploy to lfcdn, optionally specifying a bucket env

About

transform a finite stream to an infinite one

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published