141 lines
4.2 KiB
Plaintext
141 lines
4.2 KiB
Plaintext
|
|
||
|
{{alias}}( [options] )
|
||
|
Returns a transform stream which splits streamed data.
|
||
|
|
||
|
Parameters
|
||
|
----------
|
||
|
options: Object (optional)
|
||
|
Options.
|
||
|
|
||
|
options.sep: string (optional)
|
||
|
Separator used to split streamed data. A separator may be either a
|
||
|
regular expression or a string. A separator which is a regular
|
||
|
expression containing a matching group will result in the separator
|
||
|
being retained in the output stream.Default: /\r?\n/.
|
||
|
|
||
|
options.objectMode: boolean (optional)
|
||
|
Specifies whether a stream should operate in "objectMode". Default:
|
||
|
false.
|
||
|
|
||
|
options.encoding: string|null (optional)
|
||
|
Specifies how Buffer objects should be decoded to strings. Default:
|
||
|
null.
|
||
|
|
||
|
options.highWaterMark: integer (optional)
|
||
|
Specifies the maximum number of bytes to store in an internal buffer
|
||
|
before ceasing to push downstream.
|
||
|
|
||
|
options.allowHalfOpen: boolean (optional)
|
||
|
Specifies whether a stream should remain open even if one side ends.
|
||
|
Default: false.
|
||
|
|
||
|
options.writableObjectMode: boolean (optional)
|
||
|
Specifies whether the writable side should be in "objectMode". Default:
|
||
|
false.
|
||
|
|
||
|
Returns
|
||
|
-------
|
||
|
stream: TransformStream
|
||
|
Transform stream.
|
||
|
|
||
|
Examples
|
||
|
--------
|
||
|
> var s = {{alias}}();
|
||
|
> s.write( 'a\nb\nc' );
|
||
|
> s.end();
|
||
|
|
||
|
|
||
|
{{alias}}.factory( [options] )
|
||
|
Returns a function for creating transform streams for splitting streamed
|
||
|
data.
|
||
|
|
||
|
Parameters
|
||
|
----------
|
||
|
options: Object (optional)
|
||
|
Options.
|
||
|
|
||
|
options.sep: string (optional)
|
||
|
Separator used to split streamed data. A separator may be either a
|
||
|
regular expression or a string. A separator which is a regular
|
||
|
expression containing a matching group will result in the separator
|
||
|
being retained in the output stream. Default: /\r?\n/.
|
||
|
|
||
|
options.objectMode: boolean (optional)
|
||
|
Specifies whether a stream should operate in "objectMode". Default:
|
||
|
false.
|
||
|
|
||
|
options.encoding: string|null (optional)
|
||
|
Specifies how Buffer objects should be decoded to strings. Default:
|
||
|
null.
|
||
|
|
||
|
options.highWaterMark: integer (optional)
|
||
|
Specifies the maximum number of bytes to store in an internal buffer
|
||
|
before ceasing to push downstream.
|
||
|
|
||
|
options.allowHalfOpen: boolean (optional)
|
||
|
Specifies whether a stream should remain open even if one side ends.
|
||
|
Default: false.
|
||
|
|
||
|
options.writableObjectMode: boolean (optional)
|
||
|
Specifies whether the writable side should be in "objectMode". Default:
|
||
|
false.
|
||
|
|
||
|
Returns
|
||
|
-------
|
||
|
createStream: Function
|
||
|
Function for creating transform streams.
|
||
|
|
||
|
Examples
|
||
|
--------
|
||
|
> var opts = { 'highWaterMark': 64 };
|
||
|
> var createStream = {{alias}}.factory( opts );
|
||
|
> var s = createStream();
|
||
|
> s.write( 'a\nb\nc' );
|
||
|
> s.end();
|
||
|
|
||
|
|
||
|
{{alias}}.objectMode( [options] )
|
||
|
Returns an "objectMode" transform stream for splitting streamed data.
|
||
|
|
||
|
Parameters
|
||
|
----------
|
||
|
options: Object (optional)
|
||
|
Options.
|
||
|
|
||
|
options.sep: string (optional)
|
||
|
Separator used to split streamed data. A separator may be either a
|
||
|
regular expression or a string. A separator which is a regular
|
||
|
expression containing a matching group will result in the separator
|
||
|
being retained in the output stream. Default: /\r?\n/.
|
||
|
|
||
|
options.encoding: string|null (optional)
|
||
|
Specifies how Buffer objects should be decoded to strings. Default:
|
||
|
null.
|
||
|
|
||
|
options.highWaterMark: integer (optional)
|
||
|
Specifies the maximum number of objects to store in an internal buffer
|
||
|
before ceasing to push downstream.
|
||
|
|
||
|
options.allowHalfOpen: boolean (optional)
|
||
|
Specifies whether a stream should remain open even if one side ends.
|
||
|
Default: false.
|
||
|
|
||
|
options.writableObjectMode: boolean (optional)
|
||
|
Specifies whether the writable side should be in "objectMode". Default:
|
||
|
false.
|
||
|
|
||
|
Returns
|
||
|
-------
|
||
|
stream: TransformStream
|
||
|
Transform stream operating in "objectMode".
|
||
|
|
||
|
Examples
|
||
|
--------
|
||
|
> var s = {{alias}}.objectMode();
|
||
|
> s.write( 'a\nb\c' );
|
||
|
> s.end();
|
||
|
|
||
|
See Also
|
||
|
--------
|
||
|
|