through2
Advanced tools
Comparing version 0.1.0 to 0.2.0
{ | ||
"name": "through2", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise", | ||
@@ -5,0 +5,0 @@ "main": "through2.js", |
@@ -48,3 +48,3 @@ # through2 | ||
<b><code>through2([ options, ] transformFunction[, flushFunction ])</code></b> | ||
<b><code>through2([ options, ] [ transformFunction ] [, flushFunction ])</code></b> | ||
@@ -74,2 +74,4 @@ Consult the **[stream.Transform](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_transform)** documentation for the exact rules of the `transformFunction` (i.e. `this._transform`) and the optional `flushFunction` (i.e. `this._flush`). | ||
If you **do not provide a `transformFunction`** then you will get a simple simple pass-through stream. | ||
### flushFunction | ||
@@ -76,0 +78,0 @@ |
@@ -5,2 +5,7 @@ const Transform = require('stream').Transform || require('readable-stream/transform') | ||
function noop (chunk, enc, callback) { | ||
this.push(chunk) | ||
callback() | ||
} | ||
function ctor (options, transform, flush) { | ||
@@ -13,2 +18,5 @@ if (typeof options == 'function') { | ||
if (typeof transform != 'function') | ||
transform = noop | ||
function Through2 (override) { | ||
@@ -15,0 +23,0 @@ if (!(this instanceof Through2)) |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
16255
290
104
0