readar
v1.0.1
Published
Read text file to array of lines
Maintainers
Readme
readar
Read text file to array of lines. Easy, sync, utf8 only, no configs required.
Why?
Because fs is too low-level for such kind of tasks.
Install
npm i readarUsage
const readar = require('readar');
readar('path/to/some/file'); // ['line1', 'line2', 'line3']
readar('path/to/some/dir'); // Error EISDIR: illegal operation on a directory, read
readar('path/to/nonExistent/file'); // Error ENOENT: no such file or directory, open \'path/to/nonExistent/file\'License
MIT
