pull-stream
Advanced tools
Comparing version 3.6.7 to 3.6.8
{ | ||
"name": "pull-stream", | ||
"description": "minimal pull stream", | ||
"version": "3.6.7", | ||
"version": "3.6.8", | ||
"homepage": "https://pull-stream.github.io", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -28,5 +28,5 @@ # pull-stream | ||
``` | ||
note that `pull(a, b, c)` is basically the same as `a.pipe(b).pipe(c)`. | ||
Note that `pull(a, b, c)` is basically the same as `a.pipe(b).pipe(c)`. | ||
to grok how pull-streams work, read through [pull-streams by example](https://github.com/dominictarr/pull-stream-examples) | ||
To grok how pull-streams work, read through [pull-streams by example](https://github.com/dominictarr/pull-stream-examples) | ||
@@ -38,3 +38,3 @@ ## How do I do X with pull-streams? | ||
Check the [pull-stream FAQ](https://github.com/pull-stream/pull-stream-faq) | ||
and post an issue if you have a question that is not on that. | ||
and post an issue if you have a question that is not covered. | ||
@@ -60,13 +60,13 @@ ## Compatibily with node streams | ||
### Source (aka, Readable) | ||
### Source (readable stream that produces values) | ||
The readable stream is just a `function read(end, cb)`, | ||
A Source is a function `read(end, cb)`, | ||
that may be called many times, | ||
and will (asynchronously) `cb(null, data)` once for each call. | ||
and will (asynchronously) call `cb(null, data)` once for each call. | ||
To signify an end state, the stream eventually returns `cb(err)` or `cb(true)`. | ||
When indicating a terminal state, `data` *must* be ignored. | ||
When signifying an end state, `data` *must* be ignored. | ||
The `read` function *must not* be called until the previous call has called back. | ||
Unless, it is a call to abort the stream (`read(truthy, cb)`). | ||
Unless, it is a call to abort the stream (`read(Error || true, cb)`). | ||
@@ -86,6 +86,7 @@ ```js | ||
### Sink; (aka, Reader, "writable") | ||
### Sink (reader or writable stream that consumes values) | ||
A sink is just a `reader` function that calls a Source (read function), | ||
until it decideds to stop, or the readable ends. `cb(err || true)` | ||
A Sink is a function `reader(read)` that calls a Source (`read(null, cb)`), | ||
until it decides to stop (by calling `read(true, cb)`), or the readable ends (`read` calls | ||
`cb(Error || true)` | ||
@@ -109,3 +110,3 @@ All [Throughs](./docs/throughs/index.md) | ||
Since these are just functions, you can pass them to each other! | ||
Since Sources and Sinks are functions, you can pass them to each other! | ||
@@ -150,6 +151,5 @@ ```js | ||
A through stream is a reader on one end and a readable on the other. | ||
It's Sink that returns a Source. | ||
That is, it's just a function that takes a `read` function, | ||
and returns another `read` function. | ||
A through stream is both a reader (consumes values) and a readable (produces values). | ||
It's a function that takes a `read` function (a Sink), | ||
and returns another `read` function (a Source). | ||
@@ -156,0 +156,0 @@ ```js |
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
72280