
Security News
Node.js TSC Votes to Stop Distributing Corepack
Corepack will be phased out from future Node.js releases following a TSC vote.
always-tail
Advanced tools
Node.js module for continuously tailing a file.
It differs from other tail
modules in that it survives truncates,
file rollovers (e.g. mv /var/log/test /var/log/test.1
), and unlink.
It does this by monitoring the filename, and when the inode changes, it will continue to read to the end of the existing file descriptor, then automatically read from the newly created file with the same name.
It emits a 'line' event when a new line is read.
npm install always-tail
var Tail = require('always-tail');
var fs = require('fs');
var filename = "/tmp/testlog";
if (!fs.existsSync(filename)) fs.writeFileSync(filename, "");
var tail = new Tail(filename, '\n');
tail.on('line', function(data) {
console.log("got line:", data);
});
tail.on('error', function(data) {
console.log("error:", data);
});
tail.watch();
// to unwatch and close all file descriptors, tail.unwatch();
var tail = new Tail(filename, separator, options);
filename
- filename to monitor
separator
- optional separator for each line (default: \n)
options.interval
- optional interval to check for changes
options.start
- optional start byte to start reading from
Code is heavily modified from the node-tail module (https://github.com/forward/node-tail)
MIT
FAQs
continuous file tail. robust enough to survive rollovers.
The npm package always-tail receives a total of 20,992 weekly downloads. As such, always-tail popularity was classified as popular.
We found that always-tail demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.
Research
Security News
Research uncovers Black Basta's plans to exploit package registries for ransomware delivery alongside evidence of similar attacks already targeting open source ecosystems.
Security News
Oxlint's beta release introduces 500+ built-in linting rules while delivering twice the speed of previous versions, with future support planned for custom plugins and improved IDE integration.