mirror of
https://github.com/nodejs/node.git
synced 2025-05-20 12:34:23 +00:00
![]() PR-URL: https://github.com/nodejs/node/pull/7999 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> |
||
---|---|---|
.. | ||
index.js | ||
package.json | ||
readme.md |
require-uncached 
Require a module bypassing the cache
Useful for testing purposes when you need to freshly require a module.
Install
$ npm install --save require-uncached
Usage
// foo.js
var i = 0;
module.exports = function () {
return ++i;
};
var requireUncached = require('require-uncached');
require('./foo')();
//=> 1
require('./foo')();
//=> 2
requireUncached('./foo')();
//=> 1
requireUncached('./foo')();
//=> 1
License
MIT © Sindre Sorhus