Nerdiest Political Manifesto
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

eval-stream

0.1.0 • Public • Published

eval-stream

Evaluate streams of JavaScript code in a given context.

Examples

Here, we read the body of an adding function from a simple through-stream:

var PassThrough = require('stream').PassThrough ||
                  require('readable-stream/passthrough');
var assert = require('assert');
 
var evalStream = require('eval-stream');
 
var ts = new PassThrough();
 
ts.pipe(evalStream({
    a: 1,
    b: 2
  }, function (err, result) {
    assert(!err);
    assert.equal(result, 3);
  }));
 
ts.write('return a + b;');
ts.end();

Keywords

install

npm i eval-stream

Downloadsweekly downloads

6

version

0.1.0

license

MIT

repository

githubgithub

last publish

collaborators

  • avatar