Skip to content
Browse files

modules folder name is configurable

  • Loading branch information...
1 parent ee5423e commit d65a42238101ea284ddafb788debdad0e5a59504 @mafintosh mafintosh committed Sep 1, 2013
Showing with 6 additions and 4 deletions.
  1. +3 −2 lib/async.js
  2. +3 −2 lib/sync.js
View
5 lib/async.js
@@ -23,6 +23,7 @@ module.exports = function resolve (x, opts, cb) {
var extensions = opts.extensions || [ '.js' ];
var y = opts.basedir || path.dirname(caller());
+ var modules = opts.modules || 'node_modules';
opts.paths = opts.paths || [];
@@ -127,10 +128,10 @@ module.exports = function resolve (x, opts, cb) {
var dirs = [];
for (var i = parts.length - 1; i >= 0; i--) {
- if (parts[i] === 'node_modules') continue;
+ if (parts[i] === modules) continue;
var dir = path.join(
path.join.apply(path, parts.slice(0, i + 1)),
- 'node_modules'
+ modules
);
if (!parts[0].match(/([A-Za-z]:)/)) {
dir = '/' + dir;
View
5 lib/sync.js
@@ -16,6 +16,7 @@ module.exports = function (x, opts) {
var extensions = opts.extensions || [ '.js' ];
var y = opts.basedir || path.dirname(caller());
+ var modules = opts.modules || 'node_modules';
opts.paths = opts.paths || [];
@@ -83,10 +84,10 @@ module.exports = function (x, opts) {
var dirs = [];
for (var i = parts.length - 1; i >= 0; i--) {
- if (parts[i] === 'node_modules') continue;
+ if (parts[i] === modules) continue;
var dir = path.join(
path.join.apply(path, parts.slice(0, i + 1)),
- 'node_modules'
+ modules
);
if (!parts[0].match(/([A-Za-z]:)/)) {
dir = '/' + dir;

0 comments on commit d65a422

Please sign in to comment.
Something went wrong with that request. Please try again.