Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gillesdemey/require-skip-cache
Require a module without adding it to the cached modules
https://github.com/gillesdemey/require-skip-cache
Last synced: 3 days ago
JSON representation
Require a module without adding it to the cached modules
- Host: GitHub
- URL: https://github.com/gillesdemey/require-skip-cache
- Owner: gillesdemey
- License: mit
- Created: 2016-01-21T21:47:09.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-21T22:19:24.000Z (almost 9 years ago)
- Last Synced: 2024-10-31T17:29:47.323Z (12 days ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# require-skip-cache
Require a module without adding it to the cached modules## Why?
You probably don't have a use for it, but I use it to dynamically create sandboxes for Node's `vm` module.
## Usage
```javascript
var _require = require('require-skip-cache')
var request = _require('request') // will not be added to Module._cacherequest('http://google.com/', function (err, res, body) {
...
})```
## References
```Module._load at module.js``` [https://github.com/nodejs/node/blob/master/lib/module.js#L295-L333](https://github.com/nodejs/node/blob/master/lib/module.js#L295-L333)