Skip to content

parse

Type: in-memory codecs (async)

Parse YAML or CSV text without touching the filesystem. These APIs are not gated by the script file settings (they still round-trip through the main process for the parser libraries).

Use built-in JSON.parse for JSON.

hc.parse.csv(text, options?)

Available since v2.0.0

Signature:(text: string, options?: object) => Promise<object[] | string[][]>

Options match hc.fs.readCsv.

hc.parse.yaml(text)

Available since v2.0.0

Signature:(text: string) => Promise<any>

hc.parse.yaml(text) scripting API.

javascript
var doc = await hc.parse.yaml(hc.response.text());