Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Reading and writing of comma-separated values (CSV) files
Classes
CsvParseStream transforms a stream of CSV-encoded text into a stream of
parsed objects.
- readable(): ReadableStream<RowType<T>>
The instance's
ReadableStream. - writable(): WritableStream<string>
The instance's
WritableStream.
Convert each chunk to a CSV record.
Functions
Interfaces
Options for CsvParseStream.
- columns: readonly string[]
List of names used for header definition.
- comment: string
Character to start a comment.
- fieldsPerRecord: number
Enabling checking number of expected fields for each row.
- lazyQuotes: boolean
Allow unquoted quote in a quoted field or non-double-quoted quotes in quoted field.
- separator: string
Character which separates values.
- skipFirstRow: boolean
If you provide
skipFirstRow: trueandcolumns, the first line will be skipped. If you provideskipFirstRow: truebut notcolumns, the first line will be skipped and used as header definitions. - trimLeadingSpace: boolean
Flag to trim the leading space of the value.
Options for CsvStringifyStream.
Options for parse.
- columns: readonly string[]
List of names used for header definition.
- comment: string
Character to start a comment.
- fieldsPerRecord: number
Enabling checking number of expected fields for each row.
- lazyQuotes: boolean
Allow unquoted quote in a quoted field or non-double-quoted quotes in quoted field.
- separator: string
Character which separates values.
- skipFirstRow: boolean
If you provide
skipFirstRow: trueandcolumns, the first line will be skipped. If you provideskipFirstRow: truebut notcolumns, the first line will be skipped and used as header definitions. - trimLeadingSpace: boolean
Flag to trim the leading space of the value.
Type Aliases
The most essential aspect of a column is accessing the property holding the
data for that column on each object in the data array. If that member is at
the top level, Column can simply be a property accessor, which is either a
string (if it's a plain object) or a number (if it's an array).
Column information.
An object (plain or array)
& { columns: readonly (infer C extends string)[]; }
& { columns?: undefined; skipFirstRow?: false | undefined; }
Parse result type for parse and CsvParseStream.
Array index or record key corresponding to a value for a data object.
Record type with column type.
Row return type.
Options for stringify.
- bom: boolean
Whether to add a byte-order mark to the beginning of the file content. Required by software such as MS Excel to properly display Unicode text.
- columns: readonly Column[]
A list of instructions for how to target and transform the data for each column of output. This is also where you can provide an explicit header name for the column.
- headers: boolean
Whether to include the row of headers or not.
- separator: string
Delimiter used to separate values. Examples:
Add Package
deno add jsr:@std/csv
Import symbol
import * as mod from "@std/csv";
Import directly with a jsr specifier
import * as mod from "jsr:@std/csv";