baptize

0.1.0 • Public • Published

baptize

Dunk an es6 generator (function or object) in the stream for good laughs.

'use strict'
var baptize = require('baptize'),
    termp = require('term-pipe');

// nifty
var fib = function*(){
  let x = bint(0), y = bint(1), z = bint(0);
  while(true){
    z = x.add(y);
    x = y;
    y = z;
    yield y;
  }
};

// it just works
baptize(fib).pipe(termp);

// it just works
baptize(fib()).pipe(termp);

Package Sidebar

Install

npm i baptize

Weekly Downloads

1

Version

0.1.0

License

MIT

Last publish

Collaborators

  • ninegrid