https://github.com/codemodsquad/invalidate-require-cache
Delete modules in a folder from require.cache unless the folder is unchanged since last call
https://github.com/codemodsquad/invalidate-require-cache
hot-reloading require
Last synced: 7 months ago
JSON representation
Delete modules in a folder from require.cache unless the folder is unchanged since last call
- Host: GitHub
- URL: https://github.com/codemodsquad/invalidate-require-cache
- Owner: codemodsquad
- License: mit
- Created: 2020-02-23T00:28:34.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T19:11:09.000Z (almost 3 years ago)
- Last Synced: 2025-03-08T13:04:27.028Z (7 months ago)
- Topics: hot-reloading, require
- Language: JavaScript
- Size: 2.71 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# invalidate-require-cache
[](https://circleci.com/gh/codemodsquad/invalidate-require-cache)
[](https://codecov.io/gh/codemodsquad/invalidate-require-cache)
[](https://github.com/semantic-release/semantic-release)
[](http://commitizen.github.io/cz-cli/)
[](https://badge.fury.io/js/invalidate-require-cache)Delete modules in a folder from require.cache unless the folder is unchanged since last call.
This is used by `jscodeshift-choose-parser` to ensure that it always uses the current version of babel installed
in a project.```js
const invalidateRequireCache = require('invalidate-require-cache')invalidateRequireCache('path/to/directory')
// now everything inside that directory has been deleted from require.cache
// (unless it is unchanged since the last call)
// and will be reloaded if you require it again.
```