Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hughsk/fresh-require
Bypass the require cache when requiring a module – works with both node and browserify
https://github.com/hughsk/fresh-require
Last synced: 12 days ago
JSON representation
Bypass the require cache when requiring a module – works with both node and browserify
- Host: GitHub
- URL: https://github.com/hughsk/fresh-require
- Owner: hughsk
- License: other
- Created: 2014-10-26T20:51:10.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2020-03-13T20:38:19.000Z (over 4 years ago)
- Last Synced: 2024-10-17T16:39:49.876Z (22 days ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 22
- Watchers: 3
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# fresh-require
![](http://img.shields.io/badge/stability-experimental-orange.svg?style=flat)
![](http://img.shields.io/npm/v/fresh-require.svg?style=flat)
![](http://img.shields.io/npm/dm/fresh-require.svg?style=flat)
![](http://img.shields.io/npm/l/fresh-require.svg?style=flat)Bypass the require cache when requiring a module – works with both node and
[browserify](http://browserify.org/).## Usage
[![NPM](https://nodei.co/npm/fresh-require.png)](https://nodei.co/npm/fresh-require/)
### `fresh(module, require)`
Where `module` is the name of the module you're requiring, as you would normally
pass to `require`. `require` should be your file's local `require` function.To use this package properly with browserify, you need to include
`fresh-require/transform` as a transform:``` bash
browserify -t fresh-require/transform ./index.js
```Then you should be able to use the package as normal:
``` javascript
var fresh = require('fresh-require')var async1 = require('async')
var async2 = fresh('async', require)
```## License
MIT. See [LICENSE.md](http://github.com/hughsk/fresh-require/blob/master/LICENSE.md) for details.