Initial commit
[yaffs-website] / node_modules / stream-consume / README.md
1 # stream-consume
2
3 A node module ensures a Readable stream continues flowing if it's not piped to
4 another destination.
5
6         npm install stream-consume
7
8 ## Usage
9
10 Simply pass a stream to `stream-consume`.
11 Both legacy streams and streams2 are supported.
12
13 ``` js
14 var consume = require('stream-consume');
15
16 consume(readableStream);
17 ```
18
19 ## Details
20
21 Only Readable streams are processed (as determined by presence of `readable`
22 property and a `resume` property that is a function). If called with anything
23 else, it's a NOP.
24
25 For a streams2 stream (as determined by presence of a `_readableState`
26 property), nothing is done if the stream has already been piped to at least
27 one other destination.
28
29 `resume()` is used to cause the stream to continue flowing.
30
31 ## License
32
33 The MIT License (MIT)
34
35 Copyright (c) 2014 Aron Nopanen
36
37 Permission is hereby granted, free of charge, to any person obtaining a copy
38 of this software and associated documentation files (the "Software"), to deal
39 in the Software without restriction, including without limitation the rights
40 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
41 copies of the Software, and to permit persons to whom the Software is
42 furnished to do so, subject to the following conditions:
43
44 The above copyright notice and this permission notice shall be included in
45 all copies or substantial portions of the Software.
46
47 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
48 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
49 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
50 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
51 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
52 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
53 THE SOFTWARE.