Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getNodeModules(cb) {
var ncp = require('ncp');
var get;
if (opts.strategy === 'copy') {
get = ncp.bind(null,
path.join(cachedir, 'node_modules'),
path.join(opts.cwd, 'node_modules'));
} else {
get = fs.symlink.bind(fs,
path.join(cachedir, 'node_modules'),
path.join(opts.cwd, 'node_modules'),
/^win/.test(process.platform) ? 'junction' : 'dir'
)
}
async.series([
lockfile.lock.bind(lockfile, copylock, lockOpts),
rimraf.bind(null, path.join(opts.cwd, 'node_modules')),
// copy or symlink
get,
lockfile.unlock.bind(lockfile, copylock)
var templateDir = __dirname + path.sep + 'templates'
var context = {
installable: null,
output: {
contents: null,
file: null
}
}
async.waterfall([
rimraf.bind(null, tempDir),
mkdirp.bind(null, tempDir),
ignoreValue,
resolvePath.bind(null, argAndOptions.arg),
storeValue.bind(null, context, 'installable'),
ncp.bind(null, templateDir, tempDir),
getValue.bind(null, context, 'installable'),
copyNpmrc.bind(null, tempDir),
cd.bind(null, tempDir),
getValue.bind(null, context, 'installable'),
npmInstall.bind(null, verbose, argAndOptions.options),
ignoreValue,
cd.bind(null, 'node_modules'),
glob.bind(null, '*'),
checkLength,
flatten,
cd,
rimraf.bind(null, '.npmbundle'),
fs.readFile.bind(null, 'package.json', 'utf8'),
jsonParse,
bundleDependencies,
disableScripts,