substack/node-browserify — pull request #290 by anatoliychakkaev (2013-02-22 19:16:48+00:00)
Title: b.fake(name, path) API for overwriting modules with alternative implementation

Added `b.fake(moduleName, alternativePath)` method:

It allows to replace some `moduleName` module with alternative implementation located at
`alternativePath`. For example:

```javascript
b.fake('express', __dirname + '/fake-express.js');
b.fake('fs', __dirname + '/client-side-fs.js');
```

`b.expose('express', alterPath)` isn't worked as expected. Maybe it's a bug, or just misunderstanding of api, but i really need possibility to overwrite some modules (both native and not native) with fake implementation.