You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 regels
376 B

4 jaren geleden
  1. /**
  2. Import a module while bypassing the cache.
  3. @example
  4. ```
  5. // foo.js
  6. let i = 0;
  7. module.exports = () => ++i;
  8. // index.js
  9. import importFresh = require('import-fresh');
  10. require('./foo')();
  11. //=> 1
  12. require('./foo')();
  13. //=> 2
  14. importFresh('./foo')();
  15. //=> 1
  16. importFresh('./foo')();
  17. //=> 1
  18. ```
  19. */
  20. declare function importFresh(moduleId: string): unknown;
  21. export = importFresh;