1.1.0 • Published 7 years ago
@ehf/ehf-file v1.1.0
ehf-file
Reads and writes files.
csv(path | paths)
Pass 1 or more paths as args to read csv files. Returns JSON (or array of JSON results), wrapped in a promise.
json(path)
Pass a path to read in a json file, wrapped in a promise.
text(path)
Pass a path to read in a text file, wrapped in a promise.
read(str | array)
Pass a str or array of paths to read in any number of files. Attempts to parse CSV/JSON based on extension. Returns array results, wrapped in a promise.
write(path, data, opts)
Write data to path. opts can include format: 'json'|'csv'|'txt'.
1.1.0
7 years ago