import-fresh
Import a module while bypassing the cache
Last updated 5 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install import-fresh 
SYNC missed versions from official npm registry.

import-fresh

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

import-fresh for enterprise

Available as part of the Tidelift Subscription.

The maintainers of import-fresh and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.

Related

Current Tags

  • 3.3.0                                ...           latest (4 years ago)

7 Versions

  • 3.3.0                                ...           4 years ago
  • 3.2.2                                ...           4 years ago
  • 3.2.1                                ...           5 years ago
  • 3.2.0                                ...           5 years ago
  • 3.1.0                                ...           5 years ago
  • 3.0.0                                ...           6 years ago
  • 2.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (4)

Copyright 2013 - present © cnpmjs.org | Home |