ProcessStandardInputStream

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val closed: Boolean

Is true after 'close' has been emitted.

Link copied to clipboard
open override val destroyed: Boolean

Is true after destroy() has been called.

Link copied to clipboard
open override val errored: Any?

Returns error if the stream has been destroyed with an error.

Link copied to clipboard
open override val fd: Int

TBD.

Link copied to clipboard
open override val readable: Boolean

Is true if it is safe to call readable.read(), which means the stream has not been destroyed or emitted 'error' or 'end'.

Link copied to clipboard
open override val readableAborted: Boolean

Returns whether the stream was destroyed or errored before emitting 'end'.

Link copied to clipboard
open override val readableDidRead: Boolean

Returns whether 'data' has been emitted.

Link copied to clipboard
open override val readableEncoding: String?

Getter for the property encoding of a given Readable stream. The encoding property can be set using the readable.setEncoding() method.

Link copied to clipboard
open override val readableEnded: Boolean

Becomes true when 'end' event is emitted.

Link copied to clipboard
open override val readableFlowing: Boolean?

This property reflects the current state of a Readable stream as described in the "Three states" section.

Link copied to clipboard
open override val readableHighWaterMark: Int

Returns the value of highWaterMark passed when creating this Readable.

Link copied to clipboard
open override val readableLength: Int

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.

Link copied to clipboard
open override val readableObjectMode: Boolean

Getter for the property objectMode of a given Readable stream.

Functions

Link copied to clipboard
open override fun addEventListener(type: String, listener: EventListener)

Adds a new handler for the type event. Any given listener is added only once per type and per capture option value.

open override fun addEventListener(type: String, options: AddEventListenerOptions, listener: EventListener)

Adds a new handler for the type event. Any given listener is added only once per type and per capture option value.

open override fun addEventListener(type: String, listener: Value, options: Value?)

Adds a new handler for the type event. Any given listener is added only once per type and per capture option value.

Link copied to clipboard
open override fun addListener(eventName: String, listener: EventListener)
open override fun addListener(eventName: String, listener: Value)

Alias for emitter.on(eventName, listener).

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun compose(stream: Stream): Duplex
open override fun compose(stream: Stream, options: ReadableComposeOptions): Duplex
open override fun compose(stream: Stream, options: Value): Duplex

Compose this stream with another one, to produce a duplex stream.

Link copied to clipboard
open override fun destroy()
open override fun destroy(error: Throwable)
open override fun destroy(error: Value)

Destroy the stream. Optionally emit an error event, and emit a close event (unless emitClose is set to false). After this call, the readable stream will release any internal resources and subsequent calls to push() will be ignored.

Link copied to clipboard
open override fun dispatchEvent(event: Event): Boolean

Dispatches the event to the list of handlers for Event.type.

Link copied to clipboard
open override fun drop(limit: Int): Readable
open override fun drop(limit: Int, options: ReadableDropOptions): Readable
open override fun drop(limit: Int, options: Value): Readable

Drop the first limit items from this stream.

Link copied to clipboard
open override fun emit(eventName: String, vararg args: Any?): Boolean

Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.

Link copied to clipboard
open override fun eventNames(): List<String>

Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or Symbols.

Link copied to clipboard
open override fun every(cbk: () -> Boolean?): JsPromise<Boolean>
open override fun every(cbk: Value): JsPromise<Boolean>
open override fun every(options: ReadableEveryOptions, cbk: () -> Boolean?): JsPromise<Boolean>
open override fun every(cbk: Value, options: Value): JsPromise<Boolean>

Check if all items in this stream match the given predicate.

Link copied to clipboard
open override fun filter(cbk: (Value) -> Boolean): Readable
open override fun filter(cbk: Value): Readable
open override fun filter(options: ReadableMapOptions, cbk: (Value) -> Boolean): Readable
open override fun filter(cbk: Value, options: Value): Readable

Filter this stream to produce results from a new Readable.

Link copied to clipboard
open override fun find(cbk: () -> Boolean?): JsPromise<Value>
open override fun find(cbk: Value): JsPromise<Value>
open override fun find(options: ReadableFindOptions, cbk: () -> Boolean?): JsPromise<Value>
open override fun find(cbk: Value, options: Value): JsPromise<Value>

Find the first item in this stream that matches the given predicate.

Link copied to clipboard
open override fun flatMap(cbk: () -> Iterable<Value>): Readable
open override fun flatMap(cbk: Value): Readable
open override fun flatMap(options: ReadableFlatMapOptions, cbk: () -> Iterable<Value>): Readable
open override fun flatMap(cbk: Value, options: Value): Readable

Map over this stream to produce a new stream of items.

Link copied to clipboard
open override fun forEach(cbk: (Value) -> Unit): JsPromise<Unit>
open override fun forEach(cbk: Value): JsPromise<Unit>
open override fun forEach(options: ReadableForEachOptions, cbk: (Value) -> Unit): JsPromise<Unit>
open override fun forEach(cbk: Value, options: Value): JsPromise<Unit>

For each item in this stream, call the given callback.

Link copied to clipboard
open override fun getIterator(): Any
Link copied to clipboard
open override fun getMaxListeners(): Int

Returns the current max listener value for the emitter.

Link copied to clipboard
open override fun getMember(key: String): Any
Link copied to clipboard
open override fun getMemberKeys(): Array<String>
Link copied to clipboard
open override fun hasMember(key: String): Boolean
Link copied to clipboard
open override fun isPaused(): Boolean

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.

Link copied to clipboard
open override fun iterator()
open override fun iterator(options: ReadableIteratorOptions)
open override fun iterator(options: Value)

Get an iterator for this stream.

Link copied to clipboard
open override fun listenerCount(eventName: String): Int

Returns the number of listeners listening to the event named eventName.

Link copied to clipboard
open override fun listeners(eventName: String): List<EventListener>

Returns an array listing the listeners for the specified event.

Link copied to clipboard
open override fun map(cbk: (Value) -> Value): Readable
open override fun map(cbk: Value): Readable
open override fun map(options: ReadableMapOptions, cbk: (Any) -> Value): Readable
open override fun map(cbk: Value, options: Value): Readable

Map over this stream to produce results from a new Readable.

Link copied to clipboard
open override fun off(eventName: String, listener: Value)

Alias for emitter.removeListener(eventName, listener).

Link copied to clipboard
open override fun on(eventName: String, listener: EventListener): EventEmitter

Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already been added.

open override fun on(eventName: String, listener: Value): EventEmitter

Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already been added.

Link copied to clipboard
open override fun once(eventName: String, listener: EventListener)

Adds a one-time listener function for the event named eventName. The next time eventName is triggered, this listener is removed and then invoked.

open override fun once(eventName: String, listener: Value)

Adds a one-time listener function for the event named eventName. The next time eventName is triggered, this listener is removed and then invoked.

Link copied to clipboard
open override fun pause(): Readable

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.

Link copied to clipboard
open override fun pipe(destination: Writable)
open override fun pipe(destination: Writable, options: ReadablePipeOptions)
open override fun pipe(destination: Writable, options: Value)

The readable.pipe() method attaches a Writable stream to the readable, causing it to switch into flowing mode.

Link copied to clipboard
open override fun prependListener(eventName: String, listener: EventListener)
open override fun prependListener(eventName: String, listener: Value)

Adds the listener function to the beginning of the listeners array for the event named eventName. No checks are made to see if the listener has already been added.

Link copied to clipboard
open override fun prependOnceListener(eventName: String, listener: EventListener)
open override fun prependOnceListener(eventName: String, listener: Value)

Adds a one-time listener function for the event named eventName to the beginning of the listener array. The next time eventName is triggered, this listener is removed, and then invoked.

Link copied to clipboard
open override fun putMember(key: String?, value: Value?)
Link copied to clipboard
open override fun rawListeners(eventName: String): List<EventListener>

Returns a copy of the array of listeners for the event named eventName, including any wrappers (such as those created by .once()).

Link copied to clipboard
open override fun read(): StringOrBufferOrAny
open override fun read(size: Int): StringOrBufferOrAny
open override fun read(size: Value): StringOrBufferOrAny

The readable.read() method reads some data from the readable stream and returns it. The data will not be returned immediately if the readable stream is in flowing mode; in that case, the data will be buffered internally, and this method will return it when it is available.

Link copied to clipboard
open override fun reduce(op: () -> Value): JsPromise<Value>
open override fun reduce(op: Value): JsPromise<Value>
open override fun reduce(initial: Value, op: () -> Value): JsPromise<Value>
open override fun reduce(op: Value, initial: Value): JsPromise<Value>
open override fun reduce(initial: Value, options: ReadableReduceOptions, op: () -> Value): JsPromise<Value>
open override fun reduce(op: Value, initial: Value, options: Value): JsPromise<Value>

Reduce this stream to a single value.

Link copied to clipboard
open override fun removeAllListeners()

Removes all listeners, or those of the specified eventName.

open override fun removeAllListeners(eventName: String)

Removes all listeners, or those of the specified eventName.

Link copied to clipboard
open override fun removeEventListener(type: String, listener: EventListener)
open override fun removeEventListener(type: String, listener: Value)
open override fun removeEventListener(type: String, listener: EventListener, options: RemoveEventListenerOptions)
open override fun removeEventListener(type: String, listener: EventListener, options: Value)
open override fun removeEventListener(type: String, listener: Value, options: Value)

Removes the listener from the list of handlers for event type.

Link copied to clipboard
open override fun removeListener(eventName: String, listener: Value)

Removes the specified listener from the listener array for the event named eventName.

Link copied to clipboard
open override fun removeMember(key: String?): Boolean
Link copied to clipboard
open override fun resume(): Readable

The readable.resume() method will cause a stream in paused mode to switch back into flowing mode. This will cause the stream to start emitting data events.

Link copied to clipboard
open override fun setEncoding(encoding: String)

The readable.setEncoding() method sets the encoding for the Readable stream. This method must be called before the first 'data' event is emitted by the stream.

Link copied to clipboard
open override fun setMaxListeners(count: Int)

Sets the maximum number of listeners for the emitter.

Link copied to clipboard
open override fun some(cbk: () -> Boolean?): JsPromise<Boolean>
open override fun some(cbk: Value): JsPromise<Boolean>
open override fun some(options: ReadableSomeOptions, cbk: () -> Boolean?): JsPromise<Boolean>
open override fun some(cbk: Value, options: Value): JsPromise<Boolean>

Check if any item in this stream matches the given predicate.

Link copied to clipboard
open override fun take(limit: Int): Readable
open override fun take(limit: Int, options: ReadableDropOptions): Readable
open override fun take(limit: Int, options: Value): Readable

Take the first limit items from this stream.

Link copied to clipboard
open override fun toArray(): JsPromise<Array<Value>>
open override fun toArray(options: ReadableToArrayOptions): JsPromise<Array<Value>>
open override fun toArray(options: Value): JsPromise<Array<Value>>

Collect all items in this stream into an array.

Link copied to clipboard
open override fun unpipe()
open override fun unpipe(destination: Writable)

The readable.unpipe() method detaches a Writable stream previously attached using readable.pipe(). The method will remove the destination from the list of destinations to which data will be written.

Link copied to clipboard
open override fun unshift(chunk: StreamChunk)
open override fun unshift(chunk: Value)
open override fun unshift(chunk: StreamChunk, encoding: String)

The readable.unshift() method pushes a chunk of data back into the internal buffer for the stream.

Link copied to clipboard
open override fun wrap(stream: Stream)

The readable.wrap() method is used to wrap a raw stream source (like a TCP socket) in a Readable stream interface.