Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Reruns the given file whenever the current working dir subtree has modifications.
It autoreloads Node.JS in case of any file changes.
$ npm install dev -g
$ node-dev app.js
Starting: app.js
> server is listening on http://127.0.0.1:8080</pre>
node-dev
will rerun app.js
whenever one of the watched files is
changed.
The module is based on inotify. So, unlike most other modules of this kind, it starts watching new files automatically.
A number of additional options make the module really flexible and extendible.
npm install dev -g
Global installation is preferred to have node-dev
utility in path.
The node-dev
is a tiny file which basically contains:
var manager = require("dev")(options);
manager.start();
The options are:
run
: the js file to run, e.g ./app.js
, it is the only required option.watchDir
: the folder to watch recursively, default: .
ignoredPaths
[ paths ]: array of ignored paths, which are not watched, members can be:
string
, matched exactly against path, like ./public
,RegExp
, e.g an extension check: /\.gif$/
function(path)
, which takes the path and returns true
if it should be ignoreddebug
: enables additional logging output about watches and changes, default: false
logger
: custom logger object, must have error(...)
and debug(...)
methods, delegates to console.log
by default. Can use any other logger.onRunOutput
: callback function(output)
, called for stdout
data from the running processonRunError
: callback function(output)
, called for stderr
data from the running processYou can use these to send error notifications and integrate with your development environment if you wish.
There are limits on the number of watched files in inotify. So make sure that you only watch your modules, not all 3rd-party npm stuff.
To change the limit:
$ echo 16384 > /proc/sys/fs/inotify/max_user_watches
Or:
$ sudo sysctl fs.inotify.max_user_watches=16364
To make the change permanent, edit the file /etc/sysctl.conf
and add this line to the end of the file:
fs.inotify.max_user_watches=16384
Tell me which features you miss?
Use Github issue tracker for that.
Thank you.
FAQs
Reruns the given file whenever the current working dir subtree has modifications.
The npm package dev receives a total of 1,779 weekly downloads. As such, dev popularity was classified as popular.
We found that dev demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.