
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Simple utility to watch file changes. A file change is a file whom's mtime is changed
Simple utility for nodejs to watch file changes.
A file change is:
A new feature is to watch folders recurively. However, polling for changes on the file system is slow. And I did not test this module on a large number of files and nested folders.
This utility is handy for e.g. automatic testing in combination with a testing frame-work, An example lives within the JakeFile (jake and docco required)
run: jake autotest
Make changes in the src/watch.js file or the specs/watchSpec.js file and see te specs running automaticly
npm install nodewatch
(Use the "-g" global switch for installing nodewatch global)
var watch = require('nodewatch');
// Adding 2 dirs relative from process.cwd()
// Nested dirs are not watched
// dirs can also be added absolute
watch.add("./spec").add("./lib/watch").onChange(function(file,prev,curr,action){
console.log(file);
console.log(prev.mtime.getTime());
console.log(curr.mtime.getTime());
console.log(action) // new, change, delete
});
// Clear (remove) the listeners
watch.clearListeners();
// Remove dirs to watch
watch.remove("./spec").remdDir("./lib/watch");
// Add a dir or file relative from process.cwd()
watch.add("./specs");
// or
watch.add("../specs");
// or
watch.add("../specs",true);
// With the last argument = true, the specs folder
// is recursive watched.
// Just watch ONE file
watch.add("../path/to/my/file.js")
// Add a dir absolute
watch.add("/absolute/path");
// Set a listener
// It will provide a file (filename as string), prev and curr stats objects
watch.onChange(function(file,prev,curr,action){
console.log(file);
console.log(prev.mtime.getTime());
console.log(curr.mtime.getTime());
console.log(action); // new, change, delete
});
// Remove a dir or file (absolute or relative)
watch.remove("./spec");
// Clear the listener(s) attached via onChange();
watch.clearListeners();
FAQs
Simple utility to watch file changes. A file change is a file whom's mtime is changed
The npm package nodewatch receives a total of 286 weekly downloads. As such, nodewatch popularity was classified as not popular.
We found that nodewatch 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.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.