repl.txt (3481B)
1 2 {{alias}}( [options,] clbk ) 3 Returns a transform stream for inspecting stream data. 4 5 Parameters 6 ---------- 7 options: Object (optional) 8 Options. 9 10 options.objectMode: boolean (optional) 11 Specifies whether a stream should operate in "objectMode". Default: 12 false. 13 14 options.highWaterMark: integer (optional) 15 Specifies the maximum number of bytes to store in an internal buffer 16 before ceasing to push downstream. 17 18 options.allowHalfOpen: boolean (optional) 19 Specifies whether a stream should remain open even if one side ends. 20 Default: false. 21 22 options.readableObjectMode: boolean (optional) 23 Specifies whether the readable side should be in "objectMode". Default: 24 false. 25 26 clbk: Function 27 Callback to invoke upon receiving data. 28 29 Returns 30 ------- 31 stream: TransformStream 32 Transform stream. 33 34 Examples 35 -------- 36 > function clbk( chunk, idx ) { console.log( chunk.toString() ); }; 37 > var s = {{alias}}( clbk ); 38 > s.write( 'a' ); 39 > s.write( 'b' ); 40 > s.write( 'c' ); 41 > s.end(); 42 43 44 {{alias}}.factory( [options] ) 45 Returns a function for creating transform streams for inspecting stream 46 data. 47 48 Parameters 49 ---------- 50 options: Object (optional) 51 Options. 52 53 options.objectMode: boolean (optional) 54 Specifies whether a stream should operate in "objectMode". Default: 55 false. 56 57 options.highWaterMark: integer (optional) 58 Specifies the maximum number of bytes to store in an internal buffer 59 before ceasing to push downstream. 60 61 options.allowHalfOpen: boolean (optional) 62 Specifies whether a stream should remain open even if one side ends. 63 Default: false. 64 65 options.readableObjectMode: boolean (optional) 66 Specifies whether the readable side should be in "objectMode". Default: 67 false. 68 69 Returns 70 ------- 71 createStream( clbk ): Function 72 Function for creating transform streams. 73 74 Examples 75 -------- 76 > var opts = { 'objectMode': true, 'highWaterMark': 64 }; 77 > var createStream = {{alias}}.factory( opts ); 78 > function clbk( chunk, idx ) { console.log( chunk.toString() ); }; 79 > var s = createStream( clbk ); 80 > s.write( 'a' ); 81 > s.write( 'b' ); 82 > s.write( 'c' ); 83 > s.end(); 84 85 86 {{alias}}.objectMode( [options,] clbk ) 87 Returns an "objectMode" transform stream for inspecting stream data. 88 89 Parameters 90 ---------- 91 options: Object (optional) 92 Options. 93 94 options.highWaterMark: integer (optional) 95 Specifies the maximum number of objects to store in an internal buffer 96 before ceasing to push downstream. 97 98 options.allowHalfOpen: boolean (optional) 99 Specifies whether a stream should remain open even if one side ends. 100 Default: false. 101 102 options.readableObjectMode: boolean (optional) 103 Specifies whether the readable side should be in "objectMode". Default: 104 false. 105 106 clbk: Function 107 Callback to invoke upon receiving data. 108 109 Returns 110 ------- 111 stream: TransformStream 112 Transform stream operating in "objectMode". 113 114 Examples 115 -------- 116 > function clbk( chunk, idx ) { console.log( chunk.toString() ); }; 117 > var s = {{alias}}.objectMode( clbk ); 118 > s.write( { 'value': 'a' } ); 119 > s.write( { 'value': 'b' } ); 120 > s.write( { 'value': 'c' } ); 121 > s.end(); 122 123 See Also 124 -------- 125