Blame view

node_modules/duplex/package.json 3.68 KB
f7563de62   Palak Handa   first commit
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
  {
    "_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
  
  <img src=https://secure.travis-ci.org/dominictarr/duplex.png?branch=master>
  
  
  Simple base class for [duplex](https://github.com/dominictarr/stream-spec#duplex) streams, that automatically handles pausing and buffering.
  
  ``` js
  
  var duplex = require('duplex')
  
  var d = duplex()
    .on('_data', function (data) {
      d.sendData(data)
    })
    .on('_end', function () {
      d.sendEnd()
    })
  ```
  
  ## API
  
  ### on('_data', function (data))
  
  Emitted when `write(data)` is called.
  
  ### on('_end', function ())
  
  Emitted when `end()` is called
  
  ### _data(data)
  
  Add `data` to the output buffer. 
  `'data'` will be emitted if the stream is not paused.
  
  ### _end()
  
  Cap the output buffer. no more data events may be added.
  `'end'` will be emitted after the buffer drains, 
  or immediately, if the stream is unpaused.
  
  ### pause()
  
  Pause the readable side of the stream.  
  This will prevent it from emitting 'data' or or 'end'
  until resume is called.
  
  ### resume()
  Unpause the readable side of the stream.  
  This will allow it to emit `'data'` and `'end'` events.  
  If there there is any data in the output buffer,  
  It will start draining immediately.  
  
  ## _pause(), emit('pause')
  
  Pause the writable side of the stream. this will cause write() to return false,
  so any streams piping into this stream will pause after thier next write.
  
  ## emit('drain')
  
  Unpause the writable side of the stream. This will cause `Stream#pipe` to call `resume()`
  on any streams piping to this stream.
  
  ## Automatic Behaviours
  
  `destroy()` is called automatically after both sides of the stream have ended.
  `write()==false` after the stream emits `'pause'`,  
  and `write()==true` after the stream emits `'drain'`.
  The user is responsible for emitting `'pause'` and `'drain'`.
  
  `resume()` will be called on `nextTick`, unless `pause()` was called manually.
  If `resume()` is manually called before the `nextTick`, the stream will start emitting data
  immediately.
  
  ## License
  
  MIT / APACHE 2
  ",
    "repository": {
      "type": "git",
      "url": "git://github.com/dominictarr/duplex.git"
    },
    "scripts": {
      "test": "node test/index.js"
    },
    "version": "1.0.0"
  }