npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

co-lazy

0.0.1

@juliangruber

npmHomeRepoSnykSocket
Downloads:0
$ npm install co-lazy
DailyWeeklyMonthlyYearly

co-lazy

Lazily create a co stream when it's first read from.

Useful for when streams need setup and you for example map them over values with co-cat.

Example

var lazy = require('co-lazy');

var stream = lazy(function*(){
  yield doSomeSetup();

  return function*(end){
    // .. the stream implementation  
  }
});

API

lazy(fn)

Lazily create a stream from fn, returning a stream immediately.

Installation

$ npm install co-lazy

License

MIT