Class: NDJSONStream
NDJSONStream is a Readable stream that emits JSON objects separated by newlines.
Extends
Readable
Constructors
new NDJSONStream(data)
new NDJSONStream(
data
):NDJSONStream
Parameters
• data: any
[]
Returns
Overrides
Readable.constructor
Source
packages/core/src/utils/serializers.ts:34
Properties
closed
readonly
closed:boolean
Is true after 'close' has been emitted.
Since
v18.0.0
Inherited from
Readable.closed
Source
packages/core/node_modules/@types/node/stream.d.ts:134
destroyed
destroyed:
boolean
Is true
after readable.destroy()
has been called.
Since
v8.0.0
Inherited from
Readable.destroyed
Source
packages/core/node_modules/@types/node/stream.d.ts:129
errored
readonly
errored:Error
Returns error if the stream has been destroyed with an error.
Since
v18.0.0
Inherited from
Readable.errored
Source
packages/core/node_modules/@types/node/stream.d.ts:139
readable
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'
.
Since
v11.4.0
Inherited from
Readable.readable
Source
packages/core/node_modules/@types/node/stream.d.ts:85
readableAborted
Experimental
readonly
readableAborted:boolean
Returns whether the stream was destroyed or errored before emitting 'end'
.
Since
v16.8.0
Inherited from
Readable.readableAborted
Source
packages/core/node_modules/@types/node/stream.d.ts:79
readableDidRead
Experimental
readonly
readableDidRead:boolean
Returns whether 'data'
has been emitted.
Since
v16.7.0, v14.18.0
Inherited from
Readable.readableDidRead
Source
packages/core/node_modules/@types/node/stream.d.ts:91
readableEncoding
readonly
readableEncoding:BufferEncoding
Getter for the property encoding
of a given Readable
stream. The encoding
property can be set using the readable.setEncoding()
method.
Since
v12.7.0
Inherited from
Readable.readableEncoding
Source
packages/core/node_modules/@types/node/stream.d.ts:96
readableEnded
readonly
readableEnded:boolean
Becomes true
when 'end'
event is emitted.
Since
v12.9.0
Inherited from
Readable.readableEnded
Source
packages/core/node_modules/@types/node/stream.d.ts:101
readableFlowing
readonly
readableFlowing:boolean
This property reflects the current state of a Readable
stream as described
in the Three states
section.
Since
v9.4.0
Inherited from
Readable.readableFlowing
Source
packages/core/node_modules/@types/node/stream.d.ts:107
readableHighWaterMark
readonly
readableHighWaterMark:number
Returns the value of highWaterMark
passed when creating this Readable
.
Since
v9.3.0
Inherited from
Readable.readableHighWaterMark
Source
packages/core/node_modules/@types/node/stream.d.ts:112
readableLength
readonly
readableLength:number
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
.
Since
v9.4.0
Inherited from
Readable.readableLength
Source
packages/core/node_modules/@types/node/stream.d.ts:119
readableObjectMode
readonly
readableObjectMode:boolean
Getter for the property objectMode
of a given Readable
stream.
Since
v12.3.0
Inherited from
Readable.readableObjectMode
Source
packages/core/node_modules/@types/node/stream.d.ts:124
captureRejectionSymbol
static
readonly
captureRejectionSymbol: typeofcaptureRejectionSymbol
Inherited from
Readable.captureRejectionSymbol
Source
packages/core/node_modules/@types/node/events.d.ts:328
captureRejections
static
captureRejections:boolean
Sets or gets the default captureRejection value for all emitters.
Inherited from
Readable.captureRejections
Source
packages/core/node_modules/@types/node/events.d.ts:333
defaultMaxListeners
static
defaultMaxListeners:number
Inherited from
Readable.defaultMaxListeners
Source
packages/core/node_modules/@types/node/events.d.ts:334
errorMonitor
static
readonly
errorMonitor: typeoferrorMonitor
This symbol shall be used to install a listener for only monitoring 'error'
events. Listeners installed using this symbol are called before the regular
'error'
listeners are called.
Installing a listener using this symbol does not change the behavior once an
'error'
event is emitted, therefore the process will still crash if no
regular 'error'
listener is installed.
Inherited from
Readable.errorMonitor
Source
packages/core/node_modules/@types/node/events.d.ts:327
Methods
[asyncIterator]
()
[asyncIterator]():
AsyncIterableIterator
<any
>
Returns
AsyncIterableIterator
<any
>
Inherited from
Readable.[asyncIterator]
Source
packages/core/node_modules/@types/node/stream.d.ts:503
_construct()?
optional
_construct(callback
):void
Parameters
• callback: (error
?) => void
Returns
void
Inherited from
Readable._construct
Source
packages/core/node_modules/@types/node/stream.d.ts:141
_destroy()
_destroy(
error
,callback
):void
Parameters
• error: Error
• callback: (error
?) => void
Returns
void
Inherited from
Readable._destroy
Source
packages/core/node_modules/@types/node/stream.d.ts:423
_read()
_read():
void
Returns
void
Overrides
Readable._read
Source
packages/core/src/utils/serializers.ts:39
addListener()
addListener(event, listener)
addListener(
event
,listener
):this
Event emitter The defined events on documents including:
- close
- data
- end
- error
- pause
- readable
- resume
Parameters
• event: "close"
• listener: () => void
Returns
this
Inherited from
Readable.addListener
Source
packages/core/node_modules/@types/node/stream.d.ts:447
addListener(event, listener)
addListener(
event
,listener
):this
Parameters
• event: "data"
• listener: (chunk
) => void
Returns
this
Inherited from
Readable.addListener
Source
packages/core/node_modules/@types/node/stream.d.ts:448
addListener(event, listener)
addListener(
event
,listener
):this
Parameters
• event: "end"
• listener: () => void
Returns
this
Inherited from
Readable.addListener
Source
packages/core/node_modules/@types/node/stream.d.ts:449
addListener(event, listener)
addListener(
event
,listener
):this
Parameters
• event: "error"
• listener: (err
) => void
Returns
this
Inherited from
Readable.addListener
Source
packages/core/node_modules/@types/node/stream.d.ts:450
addListener(event, listener)
addListener(
event
,listener
):this
Parameters
• event: "pause"
• listener: () => void
Returns
this
Inherited from
Readable.addListener
Source
packages/core/node_modules/@types/node/stream.d.ts:451
addListener(event, listener)
addListener(
event
,listener
):this
Parameters
• event: "readable"
• listener: () => void
Returns
this
Inherited from
Readable.addListener
Source
packages/core/node_modules/@types/node/stream.d.ts:452
addListener(event, listener)
addListener(
event
,listener
):this
Parameters
• event: "resume"
• listener: () => void
Returns
this
Inherited from
Readable.addListener
Source
packages/core/node_modules/@types/node/stream.d.ts:453
addListener(event, listener)
addListener(
event
,listener
):this
Parameters
• event: string
| symbol
• listener: (...args
) => void
Returns
this
Inherited from
Readable.addListener
Source
packages/core/node_modules/@types/node/stream.d.ts:454
destroy()
destroy(
error
?):this
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.
Once destroy()
has been called any further calls will be a no-op and no
further errors except from _destroy()
may be emitted as 'error'
.
Implementors should not override this method, but instead implement readable._destroy()
.
Parameters
• error?: Error
Error which will be passed as payload in 'error'
event
Returns
this
Inherited from
Readable.destroy
Since
v8.0.0
Source
packages/core/node_modules/@types/node/stream.d.ts:435
emit()
emit(event)
emit(
event
):boolean
Parameters
• event: "close"
Returns
boolean
Inherited from
Readable.emit
Source
packages/core/node_modules/@types/node/stream.d.ts:455
emit(event, chunk)
emit(
event
,chunk
):boolean
Parameters
• event: "data"
• chunk: any
Returns
boolean
Inherited from
Readable.emit
Source
packages/core/node_modules/@types/node/stream.d.ts:456
emit(event)
emit(
event
):boolean
Parameters
• event: "end"
Returns
boolean
Inherited from
Readable.emit
Source
packages/core/node_modules/@types/node/stream.d.ts:457
emit(event, err)
emit(
event
,err
):boolean
Parameters
• event: "error"
• err: Error
Returns
boolean
Inherited from
Readable.emit
Source
packages/core/node_modules/@types/node/stream.d.ts:458
emit(event)
emit(
event
):boolean
Parameters
• event: "pause"
Returns
boolean
Inherited from
Readable.emit
Source
packages/core/node_modules/@types/node/stream.d.ts:459
emit(event)
emit(
event
):boolean
Parameters
• event: "readable"
Returns
boolean
Inherited from
Readable.emit
Source
packages/core/node_modules/@types/node/stream.d.ts:460
emit(event)
emit(
event
):boolean
Parameters
• event: "resume"
Returns
boolean
Inherited from
Readable.emit
Source
packages/core/node_modules/@types/node/stream.d.ts:461
emit(event, args)
emit(
event
, ...args
):boolean
Parameters
• event: string
| symbol