0.2.0 • Published 2 years ago

reverse-read-line v0.2.0

Weekly downloads
7
License
ISC
Repository
github
Last release
2 years ago

Build Status Coverage Status

reverse-read-line

Read text file line by line from end.

install

npm install reverse-read-line

Usage

import * as rrl from 'reverse-read-line';

const reader = rrl.create(filename, options); 
const lines = await reader.readLines(2);
await reader.close();
console.log(lines);

stream:

import * as rrl from 'reverse-read-line';

const stream = rrl.createStream(filename, options); 
stream.on('data', (line) => {
  console.log(line);
});

read lines:

import * as rrl from 'reverse-read-line';

const lines = await rrl.readLines(filename, 5, options); 
console.log(lines);

Options:

nametypedefaultdescription
encodingstring'utf8'the file encoding
bufferSizenumber4096the size will be read once
separatorstringundefinedline separator. if undefined it will auto judging
0.2.0

2 years ago

0.1.5

2 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago