forked from zhurui/management
zhurui 54669c07cf | ||
---|---|---|
.. | ||
index.js | ||
license | ||
package.json | ||
readme.md |
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
let i = 0;
module.exports = () => ++i;
const requireUncached = require('require-uncached');
require('./foo')();
//=> 1
require('./foo')();
//=> 2
requireUncached('./foo')();
//=> 1
requireUncached('./foo')();
//=> 1
Related
- clear-require - Clear a module from the require cache
License
MIT © Sindre Sorhus