
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
re-require-module
Advanced tools
Replacement for node.js require that that always reads the required module again from disk. It actually automatically uncaches it before requiring it again for you. This allows changes to become live without restarting node. It is like a simple hot requir
Drop-in replacement for node.js require that always reads the required module again from disk. It actually automatically uncaches it before requiring it again for you. This allows changes to become live without restarting node. It is like a simple hot require. It is also similar to decache except it also does the require again part for you.
If so, then re-require-module is an easy, simple and lightweight way for you to achieve 'hot' style code reloading.
The way re-require-module works is it just uncaches the module you give it, before returning what you'd usually get out of require. This way whatever change you make is always loaded at the point in code that you reRequire it.
When using it, the key thing to make it work is that, you must put the reRequire call somewhere where it will be called each time a request is made.
Also note that if your module has state inside, the state will be wiped out on reRequire.
You can actually leave your reRequire call in production. re-require-module detects that if in production mode, it will not reload code and will hit the disk only on the first reRequire call.
npm install re-require-module --save
// app.js
var http = require('http');
var reRequire = require('re-require-module').reRequire;
var server = http.createServer(function(req, res) {
// put reRequire in here so that a reRequire is made on each request
reRequire('./handler').handleRequest(req, res);
});
server.listen(8080);
// handler.js
module.exports.handleRequest = function(req, res){
res.end('Try editing this and refresh. No need to restart node!');
}
node example/app
http://localhost:8080.handler.jsFAQs
Replacement for node.js require that that always reads the required module again from disk. It actually automatically uncaches it before requiring it again for you. This allows changes to become live without restarting node. It is like a simple hot requir
The npm package re-require-module receives a total of 9 weekly downloads. As such, re-require-module popularity was classified as not popular.
We found that re-require-module 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.