The idea:

// inside index.jsrequire.use('fs', 'node_modules/third/party', 
require('./smart-fs'))

After this the  third party module uses our smart file system instead of 
built in.

The example implementation is here<https://github.com/eldargab/node-runtime>. 
While it can be used right know it will make much more sense if supported 
by core.
Personally I find this idea easy to implement, consistent with current 
require system, rules introduced are simple and easy to follow.

The primary use case for this is mocking.

Reply via email to