import-fresh
- Version 3.3.1
- Published
- 4.69 kB
- 2 dependencies
- MIT license
Install
npm i import-fresh
yarn add import-fresh
pnpm add import-fresh
Overview
Import a module while bypassing the cache
Index
Functions
Functions
function importFresh
importFresh: <T>(moduleId: string) => T;
Import a module while bypassing the cache.
Example 1
// foo.jslet i = 0;module.exports = () => ++i;// index.jsimport importFresh = require('import-fresh');require('./foo')();//=> 1require('./foo')();//=> 2importFresh('./foo')();//=> 1importFresh('./foo')();//=> 1const foo = importFresh<typeof import('./foo')>('./foo');
Package Files (1)
Dependencies (2)
Dev Dependencies (4)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/import-fresh
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/import-fresh)
- HTML<a href="https://www.jsdocs.io/package/import-fresh"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3363 ms. - Missing or incorrect documentation? Open an issue for this package.