The internal entries iterator. In some cases iterating over lines is simple. For example, if we create an instance from string or array we already have all the lines. However, if the input is a file, the entries iterator will be a function that reads and parses one line at a time.
The internal lines iterator. In some cases iterating over lines is simple. For example, if we create an instance from string or array we already have all the lines. However, if the input is a file, the lines iterator will be a function that reads one line at a time.
The entries iterator of the instance. Yields lines as objects.
The lines iterator of the instance. Yields lines as strings.
Sets the entries iterator of the instance. Useful while composing an instance from different sources. The "entries" might be JSON objects representing NDJSON lines or JS arrays of strings representing a line in CSV or TSV file.
The instance to allow chaining
Sets the entries iterator of the instance. Useful while composing an instance from different sources
The iterator to use
The instance to allow chaining
Converts the contents of the collection to array of "values". The subclasses must implement this depending on the output format they represent.
Writes the collection to a file. The subclasses must implement this depending on the output format they represent.
Converts the contents of the collection to array of "values". The values are json objects representing each line. The result does not include the header in case of delimited formats.
NOTE: Don't use this for big objects/files because the output array is built into memory and then returned. For big files iterate over the entries instead, which will yield the same objects:
for (const entry of collection.entries()) {
// entry is an object representing a row
}
Serializes the contents of the collection to a string. The subclasses must implement this depending on the output format they represent.
Converts the contents of the collection to an array of strings. The subclasses must implement this depending on the output format they represent.
Generated using TypeDoc
This class represents a collection of data entries. An instance can be created from different kinds of input using the static methods starting with
from
(that are available on the subclasses) and converted to other kinds of output using the instance methods starting withto
.This class is designed to handle large files or directories by using iterators and reading files one line at a time.