Readable
See: https://nodejs.org/api/stream.html#stream_class_stream_readable
Instance Members
Is true
after readable.destroy()
has been called.
See: https://nodejs.org/api/stream.html#stream_readable_destroyed
Is true
if it is safe to call readable.read()
.
See: https://nodejs.org/api/stream.html#stream_readable_readable
Getter for the property encoding
of a given Readable
stream.
The encoding
property can be set using the readable.setEncoding()
method.
See: https://nodejs.org/api/stream.html#stream_readable_readableencoding
Becomes true
when 'end'
event is emitted.
See: https://nodejs.org/api/stream.html#stream_readable_readableended
readableHighWaterMark: Int
Returns the value of highWaterMark
passed when constructing this Readable
.
See: https://nodejs.org/api/stream.html#stream_readable_readablehighwatermark
This property contains the number of bytes (or objects) in the queue ready to be read.
The value provides introspection data regarding the status of the highWaterMark
.
See: https://nodejs.org/api/stream.html#stream_readable_readablelength
Getter for the property objectMode
of a given Readable
stream.
See: https://nodejs.org/api/stream.html#stream_readable_readableobjectmode
Terminal read streams (i.e. process.stdin) have this property set to true.
It is false for any other read streams.
See: https://nodejs.org/api/tty.html#tty_readstream_istty
Destroy the stream. Optionally emit an 'error'
event, and emit a 'close'
event unless emitClose
is set in false
.
After this call, the readable stream will release any internal resources and subsequent calls to push()
will be ignored.
Implementors should not override this method, but instead implement readable._destroy()
.
See: https://nodejs.org/api/stream.html#stream_readable_destroy_error
The readable.isPaused()
method returns the current operating state of the Readable
.
This is used primarily by the mechanism that underlies the readable.pipe()
method.
In most typical cases, there will be no reason to use this method directly.
See: https://nodejs.org/api/stream.html#stream_readable_ispaused
The readable.pause()
method will cause a stream in flowing mode to stop emitting 'data'
events,
switching out of flowing mode. Any data that becomes available will remain in the internal buffer.
See: https://nodejs.org/api/stream.html#stream_readable_pause
pipe(destination: pipe.T, ?options: AnonStruct): pipe.T
The readable.pipe()
method attaches a Writable
stream to the readable
,
causing it to switch automatically into flowing mode and push all of its data to the attached Writable
.
The flow of data will be automatically managed so that the destination Writable
stream
is not overwhelmed by a faster Readable
stream.
See: https://nodejs.org/api/stream.html#stream_readable_pipe_destination_options
Name |
Type |
Default |
destination |
pipe.T |
|
options |
AnonStruct |
(optional) |
The readable.read()
method pulls some data out of the internal buffer and returns it.
If no data available to be read, null
is returned. By default,
the data will be returned as a Buffer
object unless an encoding has been specified using
the readable.setEncoding()
method or the stream is operating in object mode.
See: https://nodejs.org/api/stream.html#stream_readable_read_size
Name |
Type |
Default |
size |
Int |
(optional) |
The readable.resume()
method causes an explicitly paused Readable
stream to resume emitting 'data'
events,
switching the stream into flowing mode.
See: https://nodejs.org/api/stream.html#stream_readable_resume
The readable.setEncoding()
method sets the character encoding for data read from the Readable
stream.
See: https://nodejs.org/api/stream.html#stream_readable_setencoding_encoding
The readable.unpipe()
method detaches a Writable
stream previously attached using the stream.pipe()
method.
See: https://nodejs.org/api/stream.html#stream_readable_unpipe_destination
Name |
Type |
Default |
destination |
IWritable |
(optional) |
Passing chunk
as null
signals the end of the stream (EOF), after which no more data can be written.
See: https://nodejs.org/api/stream.html#stream_readable_unshift_chunk_encoding
Prior to Node.js 0.10, streams did not implement the entire stream
module API as it is currently defined.
(See Compatibility for more information.)
See: https://nodejs.org/api/stream.html#stream_readable_wrap_stream
The readable.push()
method is intended be called only by Readable
implementers,
and only from within the readable._read()
method.
See: https://nodejs.org/api/stream.html#stream_readable_push_chunk_encoding
See: https://nodejs.org/api/stream.html#stream_new_stream_readable_options
Name |
Parameters |
:jsRequire |
"stream", "Readable" |