708737b2f6b68e7bd98a862bfadac15680f37b6d
[dotfiles/.git] / index.d.ts
1 /**
2 Import a module while bypassing the cache.
3
4 @example
5 ```
6 // foo.js
7 let i = 0;
8 module.exports = () => ++i;
9
10 // index.js
11 import importFresh = require('import-fresh');
12
13 require('./foo')();
14 //=> 1
15
16 require('./foo')();
17 //=> 2
18
19 importFresh('./foo')();
20 //=> 1
21
22 importFresh('./foo')();
23 //=> 1
24 ```
25 */
26 declare function importFresh(moduleId: string): unknown;
27
28 export = importFresh;