import-fresh
    Overview
    Documentation
    Tutorials
    Chat
    Insights
    Code
    Dependencies
    Contributors
    Jobs

import-fresh

Import a module while bypassing the cache

3.1.0  •  Updated 9 months ago  •  by Sindre Sorhus  •  MIT License

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


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Popularity

Maintenance

Development

Last ver 9 months ago
Created 3 years ago
Last commit 5 months ago
3 months between commits

Technology

Node version: 10.16.0
4.5K unpacked

Compliance

MIT License
OSI Approved
0 vulnerabilities

Contributors

5 contributors
Sindre Sorhus
Maintainer, 21 commits, 5 merges
Yanis Benson
2 commits, 2 PRs
Adam Močkoř
1 commits, 1 PRs
Works at Lighting Beetle
Corey Farrell
1 commits, 1 PRs
Works at CFWare, LLC
Ronen Amiel
1 commits, 1 PRs
Works at wix
Arthur Verschaeve
Maintainer

Tags

require
cache
uncache
uncached
module
fresh
bypass
Openbase helps developers choose among and use millions of open-source packages, so they can build amazing products faster.
FacebookTwitterLinkedIn
© 2020 Devstore, Inc.