mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
docs(csv): add module docs (#5157)
This commit is contained in:
parent
1b092bf12a
commit
162e000be8
14
csv/mod.ts
14
csv/mod.ts
@ -1,7 +1,19 @@
|
||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||
// This module is browser compatible.
|
||||
|
||||
/** Reads and writes comma-separated values (CSV) files.
|
||||
/**
|
||||
* Reads and writes comma-separated values (CSV) files.
|
||||
*
|
||||
* ```ts
|
||||
* import { parse } from "@std/csv/parse";
|
||||
* import { assertEquals } from "@std/assert/assert-equals";
|
||||
*
|
||||
* const string = "a,b,c\nd,e,f";
|
||||
*
|
||||
* assertEquals(parse(string, { skipFirstRow: false }), [["a", "b", "c"], ["d", "e", "f"]]);
|
||||
* assertEquals(parse(string, { skipFirstRow: true }), [{ a: "d", b: "e", c: "f" }]);
|
||||
* assertEquals(parse(string, { columns: ["x", "y", "z"] }), [{ x: "a", y: "b", z: "c" }, { x: "d", y: "e", z: "f" }]);
|
||||
* ```
|
||||
*
|
||||
* There are many kinds of CSV files; this module supports the format described
|
||||
* in {@link https://www.rfc-editor.org/rfc/rfc4180.html | RFC 4180}.
|
||||
|
Loading…
Reference in New Issue
Block a user