Socket
Socket
Sign inDemoInstall

pull-stream

Package Overview
Dependencies
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pull-stream - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

9

index.js

@@ -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))

2

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc