modules folder name is configurable #32

merged 1 commit into from Sep 2, 2013


None yet
2 participants

mafintosh commented Sep 1, 2013

Make the name of the modules folder configurable to something other than node_modules by setting opts.modules.
This allows you to use the node resolve algorithm to resolve all kinds of crazy stuff like config files, templates etc.

var resolve = require('resolve');
// use config instead of node_modules and find the nearest config file
var configPath = resolve('test', {
    modules: 'config',
    extensions: ['json']
// use views for our templates
var templatePath = resolve('my-template', {
    modules: 'views',
    extensions: ['html']

@substack substack merged commit d65a422 into browserify:master Sep 2, 2013

1 check passed

default The Travis CI build passed

substack commented Sep 2, 2013

Published in 0.5.0. I renamed opts.modules to opts.moduleDirectory to be a bit more descriptive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment