next() Packaged Middleware
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

import-fresh

2.0.0 • Public • Published

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 --save 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

License

MIT © Sindre Sorhus

install

npm i import-fresh

Downloadsweekly downloads

3,436

version

2.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar