pull-stream
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -180,3 +180,3 @@ | ||
var duplex(_reader, _readable) { | ||
var duplex = function (_reader, _readable) { | ||
return function (readable) { | ||
@@ -215,2 +215,9 @@ return function (reader) { | ||
(highWaterMark(2)) | ||
(compose(map(function (e) { | ||
return e * 1000 | ||
}), | ||
map(function (e) { | ||
return Math.round(e / 3) | ||
})) | ||
) | ||
(writeArray(console.log)) | ||
@@ -217,0 +224,0 @@ // (drain(console.log)) |
{ | ||
"name": "pull-stream", | ||
"description": "", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"homepage": "https://github.com/dominictarr/pull-stream", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -12,2 +12,20 @@ # pull-stream | ||
## Examples | ||
What if implementing a stream was this simple: | ||
### Pipeable | ||
``` js | ||
var pipeable = require('pull-stream').pipeable | ||
var createStream = pipeable(function (readable) { | ||
return function read (end, cb) { | ||
readable(end, cb) | ||
} | ||
}) | ||
``` | ||
### Readable & Reader vs. Readable & Writable | ||
Instead of a readable stream, and a writable stream, there is a `readable` stream, | ||
@@ -57,2 +75,4 @@ and a `reader` stream. | ||
### Duplex | ||
``` js | ||
@@ -71,2 +91,4 @@ var map = function (readable, map) { | ||
### function composition style "pipe" | ||
``` js | ||
@@ -82,2 +104,4 @@ logger( | ||
### pipeability | ||
So, we want to pass in the `readable` and `reader` function! | ||
@@ -125,2 +149,5 @@ It needs to be that order, so that it reads left to right. | ||
### Left-to-Right pipe | ||
Now PIPE THEM TOGETHER! | ||
@@ -127,0 +154,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9623
201
159