Skip to content
/ readar Public

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

License

Notifications You must be signed in to change notification settings

astur/readar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published