fs-reader

1.0.4 • Public • Published

fs-reader

Reads whole file, or just tail or head, only as needed (won't explode RAM)

const reader = require('fs-reader');
//...
const file = '/test.txt';
const lines = 100;
reader(file, lines, function(err, contents){
    if(err) throw err;
    console.log(contents);
});

file: path to the file to read. Can be absolute or relative (from __dirname)

lines: Positive line number means head, negative means tail, 0 or null means whole.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.40latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i fs-reader

Weekly Downloads

0

Version

1.0.4

License

ISC

Unpacked Size

4.71 kB

Total Files

4

Last publish

Collaborators

  • jestdotty