A stream-based replacement for JSON.stringify and JSON.parse.
npm install @terrencecrowley/jsonstreamInitialize with optional parameters to set maximum token sizes.
Call start() with a stream in Buffer mode to start parsing.
The following standard events are emitted.
Note: If the 'error' event is emitted, no 'end' event is emitted.
Passes an object of type Error with detailed information about parsing error.
Passes an object of type any that contains the fully parsed object.
Passed after 'end' event when stream is closed.
If emitIncremental is called, individual properties associated with the given named property are returned
incrementally rather than appended to the aggregate object.
The following events are emitted when encountering a value in such a field.
Passes the name of the field passed to emitIncremental that caused this event and the value that would have
been pushed into the array.
Passes the name of the field passed to emitIncremental that caused this event, the property name that would
have been added to the object and the property value.
Initialize with optional parameters and then call start() with a writeable stream and the object to write.