package.json
3.68 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
"_args": [
[
"duplex@~1.0.0",
"/home/palak/projects/startupjalsa-backend/node_modules/mux-demux"
]
],
"_from": "duplex@>=1.0.0 <1.1.0",
"_id": "duplex@1.0.0",
"_inCache": true,
"_installable": true,
"_location": "/duplex",
"_npmUser": {
"email": "dominic.tarr@gmail.com",
"name": "dominictarr"
},
"_npmVersion": "1.1.59",
"_phantomChildren": {},
"_requested": {
"name": "duplex",
"raw": "duplex@~1.0.0",
"rawSpec": "~1.0.0",
"scope": null,
"spec": ">=1.0.0 <1.1.0",
"type": "range"
},
"_requiredBy": [
"/mux-demux"
],
"_resolved": "https://registry.npmjs.org/duplex/-/duplex-1.0.0.tgz",
"_shasum": "6abc5c16ec17e4c578578727126700590d3a2dda",
"_shrinkwrap": null,
"_spec": "duplex@~1.0.0",
"_where": "/home/palak/projects/startupjalsa-backend/node_modules/mux-demux",
"author": {
"email": "dominic.tarr@gmail.com",
"name": "Dominic Tarr",
"url": "http://dominictarr.com"
},
"bugs": {
"url": "https://github.com/dominictarr/duplex/issues"
},
"dependencies": {},
"description": "base class for a duplex stream",
"devDependencies": {},
"directories": {},
"dist": {
"shasum": "6abc5c16ec17e4c578578727126700590d3a2dda",
"tarball": "https://registry.npmjs.org/duplex/-/duplex-1.0.0.tgz"
},
"homepage": "https://github.com/dominictarr/duplex",
"maintainers": [
{
"email": "dominic.tarr@gmail.com",
"name": "dominictarr"
}
],
"name": "duplex",
"optionalDependencies": {},
"readme": "# duplex\n\n<img src=https://secure.travis-ci.org/dominictarr/duplex.png?branch=master>\n\n\nSimple base class for [duplex](https://github.com/dominictarr/stream-spec#duplex) streams, that automatically handles pausing and buffering.\n\n``` js\n\nvar duplex = require('duplex')\n\nvar d = duplex()\n .on('_data', function (data) {\n d.sendData(data)\n })\n .on('_end', function () {\n d.sendEnd()\n })\n```\n\n## API\n\n### on('_data', function (data))\n\nEmitted when `write(data)` is called.\n\n### on('_end', function ())\n\nEmitted when `end()` is called\n\n### _data(data)\n\nAdd `data` to the output buffer. \n`'data'` will be emitted if the stream is not paused.\n\n### _end()\n\nCap the output buffer. no more data events may be added.\n`'end'` will be emitted after the buffer drains, \nor immediately, if the stream is unpaused.\n\n### pause()\n\nPause the readable side of the stream. \nThis will prevent it from emitting 'data' or or 'end'\nuntil resume is called.\n\n### resume()\nUnpause the readable side of the stream. \nThis will allow it to emit `'data'` and `'end'` events. \nIf there there is any data in the output buffer, \nIt will start draining immediately. \n\n## _pause(), emit('pause')\n\nPause the writable side of the stream. this will cause write() to return false,\nso any streams piping into this stream will pause after thier next write.\n\n## emit('drain')\n\nUnpause the writable side of the stream. This will cause `Stream#pipe` to call `resume()`\non any streams piping to this stream.\n\n## Automatic Behaviours\n\n`destroy()` is called automatically after both sides of the stream have ended.\n`write()==false` after the stream emits `'pause'`, \nand `write()==true` after the stream emits `'drain'`.\nThe user is responsible for emitting `'pause'` and `'drain'`.\n\n`resume()` will be called on `nextTick`, unless `pause()` was called manually.\nIf `resume()` is manually called before the `nextTick`, the stream will start emitting data\nimmediately.\n\n## License\n\nMIT / APACHE 2\n",
"repository": {
"type": "git",
"url": "git://github.com/dominictarr/duplex.git"
},
"scripts": {
"test": "node test/index.js"
},
"version": "1.0.0"
}