readar

1.0.1 • Public • Published

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

Package Sidebar

Install

npm i readar

Weekly Downloads

5

Version

1.0.1

License

MIT

Unpacked Size

3.54 kB

Total Files

8

Last publish

Collaborators

  • astur