Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
reroute require for mocks, wrappers, or shenanigans
JavaScript
tree: 55e3c094da

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test
README.markdown
common.js
index.js
modules.js
node.js
remap.js
resolve.js

README.markdown

Remap - reroute require for mocks, wrappers, or shenanigans

some module loading ...

rm = new module.constructor('rm',module) rm.load('/home/dominic/code/node/remap/test/./remap.asynct.js') rm.exports { 'Change what require will resolve': [Function], 'load two different modules through one name by remapping': [Function] }

...will have to drag out the module code though, and open it up a little...

hell, can even assign what i like to

require.cache

require.cache[rm.filename] = rm

this is what I came here for.

Something went wrong with that request. Please try again.