substack/node-browserify — pull request #336 by andreypopp (2013-03-22 09:10:25+00:00)
Title: Pass extensions opts key to module-deps and browser-resolve calls

This is due #326 — to allow requiring non-js files w/o extensions while using browserify.

This pull request depends on shtylman/node-browser-resolve#12 and substack/module-deps#5 and doesn't have tests while I'll add some if you are willing to accepts such functionality. Please note that I don't want this pull request to be merged, this is just to describe an idea and provide a use-case for pull requests mentioned above — API implemented now is quite verbose and dirty.

Basically it allows to specify which file extensions modules can have, so instead of considering only `.js` files it could be configured to to look for `.coffee` files for example:
```
browserify --extension '.coffee' --extension '.mustache' ...
```
So you can write simply `require('module')` for requiring `module.coffee`.

I think that CoffeeScript (actually same goes for TypeScript and Roy and others langs compiled to js) community can benefit a lot from this because it is natural to think of coffeescript modules as interchangeable with "native" javascript modules — even Node allows loading coffee modules via `require.extensions` registry.