Duplex

js.node.events.EventEmitterjs.node.StreamReadablejs.node.stream.Duplex (extern class) → Transform

Duplex streams are streams that implement both the Readable and Writable interfaces.

See: https://nodejs.org/api/stream.html#stream_class_stream_duplex

Instance Members

writable: Bool

Is true if it is safe to call writable.write().

See: https://nodejs.org/api/stream.html#stream_writable_writable

writableEnded: Bool

Is true after writable.end() has been called. This property does not indicate whether the data has been flushed, for this use writable.writableFinished instead.

See: https://nodejs.org/api/stream.html#stream_writable_writableended

writableFinished: Bool

Is set to true immediately before the 'finish' event is emitted.

See: https://nodejs.org/api/stream.html#stream_writable_writablefinished

writablehighWaterMark: Int

Return the value of highWaterMark passed when constructing this Writable.

See: https://nodejs.org/api/stream.html#stream_writable_writablehighwatermark

writableLength: Int

This property contains the number of bytes (or objects) in the queue ready to be written. The value provides introspection data regarding the status of the highWaterMark.

See: https://nodejs.org/api/stream.html#stream_writable_writablelength

writableObjectMode: Bool

Getter for the property objectMode of a given Writable stream.

See: https://nodejs.org/api/stream.html#stream_writable_writableobjectmode

cork(): Void

The writable.cork() method forces all written data to be buffered in memory. The buffered data will be flushed when either the stream.uncork() or stream.end() methods are called.

See: https://nodejs.org/api/stream.html#stream_writable_cork

end(chunk: Dynamic, ?encoding: String, ?callback: haxe.extern.EitherType<Function, Function>): Void

Calling the writable.end() method signals that no more data will be written to the Writable. The optional chunk and encoding arguments allow one final additional chunk of data to be written immediately before closing the stream. If provided, the optional callback function is attached as a listener for the 'finish' event.

See: https://nodejs.org/api/stream.html#stream_writable_end_chunk_encoding_callback
Name Type Default
chunk Dynamic
encoding String (optional)
callback haxe.extern.EitherType<Function, Function> (optional)

setDefaultEncoding(encoding: String): js.node.stream.Duplex.TSelf

The writable.setDefaultEncoding() method sets the default encoding for a Writable stream.

See: https://nodejs.org/api/stream.html#stream_writable_setdefaultencoding_encoding
Name Type
encoding String
Returns
js.node.stream.Duplex.TSelf

uncork(): Void

The writable.uncork() method flushes all data buffered since stream.cork() was called.

See: https://nodejs.org/api/stream.html#stream_writable_uncork

write(chunk: Dynamic, ?encoding: String, ?callback: haxe.extern.EitherType<Function, Function>): Bool

The writable.write() method writes some data to the stream, and calls the supplied callback once the data has been fully handled. If an error occurs, the callback may or may not be called with the error as its first argument. To reliably detect write errors, add a listener for the 'error' event.

See: https://nodejs.org/api/stream.html#stream_writable_write_chunk_encoding_callback
Name Type Default
chunk Dynamic
encoding String (optional)
callback haxe.extern.EitherType<Function, Function> (optional)
Returns
Bool

Destroy the stream. Optionally emit an 'error' event, and emit a 'close' event unless emitClose is set in false.

See: https://nodejs.org/api/stream.html#stream_writable_destroy_error, https://nodejs.org/api/stream.html#stream_readable_destroy_error
Name Type Default
error js.lib.Error (optional)
Returns
js.node.stream.Duplex.TSelf

new(?options: Null<DuplexNewOptions>): Void
See: https://nodejs.org/api/stream.html#stream_constructor_new_stream_writable_options, https://nodejs.org/api/stream.html#stream_new_stream_readable_options
Name Type Default
options Null<DuplexNewOptions> (optional)

Metadata

Name Parameters
:jsRequire "stream", "Duplex"