1.0.1 • Published 6 years ago

readar v1.0.1

Weekly downloads
163
License
MIT
Repository
github
Last release
6 years ago

readar

Read text file to array of lines. Easy, sync, utf8 only, no configs required.

Build Status NPM version

Why?

Because fs is too low-level for such kind of tasks.

Install

npm i readar

Usage

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