Construct a new Parser instance using the given configuration and serialized CSV data input.
Note that a call to the Parser.parse method will be required to assign a data source to the Parser instance before it can provide useful parsing behavior.
Optional Options object to determine parsing behavior for this Parser instance.
Row separator string.
Quote/escape character.
Whether to quote/escape all columns when serializing.
Column separator character.
Implement ES6 iterable interface.
This instance, which is both an iterable and an iterator.
Implement ES6 iterator interface.
An ES6 iterator result object having "done" and "value" properties.
Parse one row from the data source and advance to the next row.
An array of column strings, or undefined if there were no rows left to parse.
Assign an input serialized CSV data source to this Parser.
The CSV data input. This can be a string, a NodeJS readable stream, or any iterable or iterator which enumerates serialized CSV data one character at a time.
This instance, for easy chaining.
Eagerly consume the entire source data in order to produce an array of
all the rows represented within the serialized CSV data.
Note that this myParser.rows()
is behaviorally identical to
Array.from(myParser)
and is provided for the sake of convenience.
An array of rows, where each row is an array of columns, and each column is simply represented by a string value.
Generated using TypeDoc
A Parser instance is used to parse CSV data according to a given configuration.