How to use the ncp.bind function in ncp

To help you get started, we’ve selected a few ncp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vvo / npm-pkgr / index.js View on Github external
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)
github majgis / npm-bundle / index.js View on Github external
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,

ncp

Asynchronous recursive file copy utility.

MIT
Latest version published 10 years ago

Package Health Score

72 / 100
Full package analysis