[Pkg-javascript-commits] [node-module-deps] 189/444: Use NODE_PATH environmental variable
Bastien Roucariès
rouca at moszumanska.debian.org
Fri Dec 15 09:47:54 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-module-deps.
commit 8196d809b63a259d302db40d0411251e6adffef1
Author: Cymen Vig <cymenvig at gmail.com>
Date: Fri Apr 11 00:01:37 2014 -0500
Use NODE_PATH environmental variable
Fixes #30
---
index.js | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/index.js b/index.js
index 055a4b2..09bfb68 100644
--- a/index.js
+++ b/index.js
@@ -39,7 +39,7 @@ module.exports = function (mains, opts) {
if (--pending === 0) output.queue(null);
}
- var top = { id: '/', filename: '/', paths: [] };
+ var top = { id: '/', filename: '/', paths: paths() };
(function () {
var pkgCount = mains.length;
@@ -252,7 +252,7 @@ module.exports = function (mains, opts) {
}
}
var p = deps.length;
- var current = { id: file, filename: file, paths: [], package: pkg };
+ var current = { id: file, filename: file, paths: paths(), package: pkg };
var resolved = {};
deps.forEach(function (id) {
@@ -338,3 +338,7 @@ function lookupPkg (file, cb) {
});
})();
}
+
+function paths () {
+ return (process.env.NODE_PATH) ? process.env.NODE_PATH.split(':') : [];
+}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-module-deps.git
More information about the Pkg-javascript-commits
mailing list