Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jpommerening/node-eval-stream
Evaluate streams of JavaScript code in a given context
https://github.com/jpommerening/node-eval-stream
Last synced: 24 days ago
JSON representation
Evaluate streams of JavaScript code in a given context
- Host: GitHub
- URL: https://github.com/jpommerening/node-eval-stream
- Owner: jpommerening
- License: mit
- Created: 2014-05-23T18:11:28.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-11-04T14:25:13.000Z (about 10 years ago)
- Last Synced: 2024-10-14T04:16:07.794Z (about 1 month ago)
- Language: JavaScript
- Size: 168 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-MIT
Awesome Lists containing this project
README
# 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:```js
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();
```