-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
34 lines (34 loc) · 1.8 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
"name": "through",
"version": "1.1.0",
"description": "simplified stream contruction",
"main": "index.js",
"scripts": {
"test": "asynct test/*.js"
},
"devDependencies": {
"stream-spec": "0",
"assertions": "2",
"asynct": "1"
},
"keywords": [
"stream",
"streams",
"user-streams",
"pipe"
],
"author": {
"name": "Dominic Tarr",
"email": "dominic.tarr@gmail.com",
"url": "dominictarr.com"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/dominictarr/through.git"
},
"homepage": "http://github.com/dominictarr/through",
"readme": "#through\n\n[![build status](https://secure.travis-ci.org/dominictarr/through.png)](http://travis-ci.org/dominictarr/through)\n\nEasy way to create a `Stream` that is both `readable` and `writable`. Pass in optional `write` and `end` methods. `through` takes care of pause/resume logic.\nUse `this.pause()` and `this.resume()` to manage flow.\nCheck `this.paused` to see current flow state. (write always returns `!this.paused`)\n\nthis function is the basis for most of the syncronous streams in [event-stream](http://github.com/dominictarr/event-stream).\n\n``` js\nvar through = require('through')\n\nthrough(function write(data) {\n this.emit('data', data)\n //this.pause() \n },\n function end () { //optional\n this.emit('end')\n })\n\n```\n\nor, with buffering on pause, use `this.queue(data)`,\ndata *cannot* be `null`. `this.queue(null)` will emit 'end'\nwhen it gets to the `null` element.\n\n``` js\nvar through = require('through')\n\nthrough(function write(data) {\n this.queue(data)\n //this.pause() \n },\n function end () { //optional\n this.queue(null)\n })\n\n```\n\n\n## License\n\nMIT / Apache2\n",
"_id": "through@1.1.0",
"_from": "through@~1.1.0"
}