
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Provides a better and normalised API between Node's 0.4 watchFile and 0.6's fsWatcher
Watchr provides a better and normalised API between Node's 0.4 watchFile and 0.6's fsWatcher.
You install it via npm istall watchr
, use it via require('watchr').watch(path,listeners,next)
. Listeners will be triggered whenever a change is made on the directory or for anything inside it (including sub-directories and so on) and are in the following format var listener = function(eventName,filePath,fileCurrentStat,filePreviousStat){}
There are three types of events for your listeners at your disposal:
change
: a file has been modifiednew
: a new file or directory has been createdunlink
: a file or a directory has been removedTo wrap it all together, it would look like this:
// Require
watchr = require('watchr')
// Watch a directory or file
watchr.watch(path,function(eventName,filePath,fileCurrentStat,filePreviousStat){
console.log('a watch event occured:',arguments);
});
You can test the above code snippet by installing watchr globally by running npm install -g watchr
to install watchr, then watchr [pathToWatch]
to watchr a particular path, and performing some file system modifications on that path.
Thanks for using Watchr!
Support can be found in the GitHub Issue Tracker
You can discover the history inside the History.md file
Licensed under the MIT License
Copyright © 2012 Bevry Pty Ltd
Copyright © 2011 Benjamin Lupton
v2.0.0 2012 April 19
change
, unlink
and new
FAQs
Better file system watching for Node.js
The npm package watchr receives a total of 22,733 weekly downloads. As such, watchr popularity was classified as popular.
We found that watchr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.