uci-utils-read-lines/api.md
David Kebler d522ac6883 refactor and improve both functions
uses promise.all now
2024-12-14 18:45:07 -08:00

1.5 KiB

Functions

readLines(files, dir)Promise.<array>

read lines from one or more files and return an array of those all those lines

writeLines(filePath, list)Promise.<null>

Writes files with a line for each element in a array or item in comma delimited list

readLines(files, dir) ⇒ Promise.<array>

read lines from one or more files and return an array of those all those lines

Kind: global function
Returns: Promise.<array> - - resolves to an single array of all lines from all files (no guarenteed order)

Param Type Description
files array | string array or comma delimited string of file paths. Can be absolute or relative (see dir)
dir string the directory to join to any relative paths

writeLines(filePath, list) ⇒ Promise.<null>

Writes files with a line for each element in a array or item in comma delimited list

Kind: global function
Returns: Promise.<null> - can catch errors but otherwise nothing resolves

Param Type Description
filePath string filepath to which file is written
list array | string each element becomes line in file