Comparing version 0.1.2 to 0.1.3
@@ -30,3 +30,3 @@ var fs = require('fs') | ||
function resolve(module) { | ||
function resolve(module, dirname) { | ||
var i, resolver, modulePath | ||
@@ -36,3 +36,3 @@ | ||
resolver = resolvers[i] | ||
if (modulePath = resolver(module)) { | ||
if (modulePath = resolver(module, dirname)) { | ||
break | ||
@@ -39,0 +39,0 @@ } |
@@ -27,5 +27,5 @@ var fs = require('fs') | ||
// if NODE_PATH is define, a global module should be natively resolved | ||
function nativeResolve(module) { | ||
function nativeResolve(module, dirname) { | ||
try { | ||
return require.resolve(module) | ||
return require.resolve(module, dirname) | ||
} catch (e) {} | ||
@@ -36,3 +36,3 @@ } | ||
// required? | ||
function nodePathResolve(module) { | ||
function nodePathResolve(module, dirname) { | ||
var i, l, modulePath | ||
@@ -53,3 +53,3 @@ var nodePath = process.env.NODE_PATH | ||
for (i = 0, l = nodePath.length; i < l; i += 1) { | ||
if (modulePath = resolveFn(module, nodePath[i])) { | ||
if (modulePath = resolveFn(module, dirname || nodePath[i])) { | ||
break; | ||
@@ -56,0 +56,0 @@ } |
{ | ||
"name": "requireg", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Require global modules like a boss", | ||
@@ -41,4 +41,5 @@ "homepage": "http://github.com/h2non/requireg", | ||
"mocha": "~1.15.1", | ||
"expect.js": "~0.2.0" | ||
"expect.js": "~0.2.0", | ||
"semver": "~2.2.1" | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11187
3