1.3.1 • Published 7 years ago

fasttail v1.3.1

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

FastTail

Tail a file or read from an index outside of the node.js event loop.

Install

npm install fasttail

Usage

const FastTail = require("fasttail");

const fastTail = new FastTail("test.txt");

// Tail a file from the end
fastTail.tailBlock((lines: string[], index: number) => {
    // new lines from tail
    // index of end of file line
    // Watches for changes
});

// Or read a file from a certain index (does not watch for changes)
fastTail.readFromIndex(10, (line: string) => {
    //every line after 10 (inclusive)
})

Settings

Change the poll rate fastTail.pollRate = 200

Change tail to beginning of file fastTail.tailFromBeginning = true

Notes

This is native module so it requires the node.js runtime

Uses memory mapping to quickly find index, so the entire file is loaded into memory for the first pass.

1.3.1

7 years ago

1.3.0

7 years ago

1.2.4

7 years ago

1.2.3

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago