tree: 295188c5944adfad6bf7520a0eeeac43b6e7326e [path history] [tgz]
  1. index.d.ts
  2. index.js
  3. license
  4. package.json
  5. readme.md
src/third_party/devtools/node_modules/import-fresh/readme.md

import-fresh Build Status

Import a module while bypassing the cache

Useful for testing purposes when you need to freshly import a module.

Install

$ npm install import-fresh

Usage

// foo.js
let i = 0;
module.exports = () => ++i;
const importFresh = require('import-fresh');

require('./foo')();
//=> 1

require('./foo')();
//=> 2

importFresh('./foo')();
//=> 1

importFresh('./foo')();
//=> 1

Related