
Product
Introducing Immutable Scans
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.
read-file-live
Advanced tools
Read a file and re-read it when it changes
npm install read-file-live
Useful if you are writing command line tools that monitor configuration files.
var readFile = require('read-file-live')
readFile('somefile.txt', function (buf) {
// is the file had been deleted buf === null
console.log('somefile.txt updated. content ->', buf)
})
var stop = readFile(onread)Read a file and re-read it when it changes. onread will be called with a buffer of the file content when the file changes or is being read the first time. If the file has been deleted the content buffer will be null.
Call stop to stop reading.
MIT
FAQs
Read a file and re-read it when it changes
We found that read-file-live 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.

Product
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.

Product
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.