Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.root = function root (module, done, global) {
if (global) npm.dir = npm.globalDir;
else npm.dir = process.cwd();
npm.config.set('global', !!global);
npm.commands.ls([], true, function (err, data) {
if (err) return done(err);
var queue = [data], found, node;
// breadth first search the tree for the node we're looking for
while (queue.length > 0) {
node = queue.shift();
// console.log(node.name);
if (node.name == module && node.path) {
done(null, node.path);
found = true;
break;
.then(function() {
console.log('versioned = %s', opts.versioned);
console.log('bin = %s', NPM.bin);
console.log('dir = %s', NPM.dir);
console.log('cache = %s', NPM.cache);
console.log('tmp = %s', NPM.tmp);
console.log('binaries = %s', SYS.inspect(BIN));
return args.pkg.reduce(function(done, pkg) {
return Q.all([done, debianize(pkg, opts)]).get(0);
}, undefined);
});
function listModules () {
console.log("Available modules:".bold);
npm.dir = process.cwd();
npm.config.set('global', false);
npm.commands.ls([], false, function (err, data) {
if (err) return app.log.error(err);
});
}
asyncMap(list, function (i, cb) {
var target = path.join(npm.dir, i[0], i[1], "package")
cache.unpack(i[0], i[1], target, cb)
buildList.push(target)
}, function (er) {
if (er) return cb(er)
get: function () {
return path.join(npm.dir, this.name, this.ver, 'package');
}
});
Object.keys(wrap.dependencies).forEach(function (depName) {
_traverseWrap(path.join(npm.dir, depName), depName, wrap.dependencies[depName]);
});
get: () => {
return path.resolve(npm.dir, '../amd_modules')
}
},
.seq(function makeSymlink() {
fs.symlink(path.join(npm.dir, modPkg), path.join(MOD_DIR, modId),
'dir', this);
})
.seq(function complete() {