How to use the ncp.ncp.limit 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 AmitMY / redux-viewer / bin / run.js View on Github external
let directory;
// Make sure there is a directory passed
if (!args.source) {
  console.error('Must pass a folder!');
  process.exit();
} else {
  directory = args.source;
}


const fs = require('fs'); // File system to write a JSON
const path = require('path'); // Path resolving
const findInFiles = require('find-in-files'); // File regex lookup
const ncp = require('ncp').ncp;

ncp.limit = 16;
ncp(path.join(__dirname, '../node_modules/force-horse/dist'), path.join(__dirname, '../viewer/force-horse'));

// Regex describing an effect
const regexSearch = new RegExp(/\/\*\*([\s\S]*?)\@type Effect([\s\S]*?)\*\//);

// Run file lookup
findInFiles.find(regexSearch, directory, '.ts$').then(result => {
  let effects = [];

  Object.keys(result).forEach(file => {
    result[file].matches.forEach(match => {
      let matchArray = match.split('\n')
        .map(l => l.trim())
        .map(l => l.substr(2, l.length - 2))
        .map(l => l.split(' '))
        .map(l => ({param: l.shift(), body: l.join(' ')}))
github tingbot / tide-electron / index.html View on Github external
e.preventDefault();
        var file = e.dataTransfer.files[0];
        console.log(file);
        console.log('File you dragged here is', file.path);
        ipcRenderer.send("fileAdd", file);

        return false;
      };

      // directory stuff
      var fs = require('fs');

      var path = require('path');
      var ncp = require('ncp').ncp;

      ncp.limit = 16;

      function saveDir(source, destination, cb) {
        var destpath = path.parse(destination);
        fs.mkdir(destpath.dir, function() {
          ncp(source, destination, function(err) {
            if (err) {
              return console.error(err);
            }
            console.log(destination);
            cb(destination);
          });
        });

      }

      //load specific .tingapp into the view
github vscode-icons / vscode-icons / src / build / build.js View on Github external
var ncp = require('ncp').ncp;
var iconGenerator = require('./iconGenerator');

var outDir = './dist';

// generating icons.json
// The function takes as second argument the directory where
// we want the file to be placed.
// Default directory is the 'root' directory

iconGenerator.generate('icons.json', outDir);

// moving to dist
ncp.limit = 16;
ncp('./src/dev', outDir, function (err) {
  if (err) {
    console.error(err);
    return;
  }
  console.log('Build completed!'); //eslint-disable-line
});
github orchoban / react.cordova / bin / reco2 / init.js View on Github external
}).on('close', function () {
                                                                                                                        // end!!!
                                                                                                                        if (!reco.state.error) {
                                                                                                                            reco.succeeded();
                                                                                                                            console.log();
                                                                                                                            console.log("run 'cd " + rootDir + "'")
                                                                                                                        }

                                                                                                                    });
                                                                                                            });



                                                                                                    });
                                                                                                });
                                                                                                ncp.limit = 9999999999999999999;


                                                                                            }
                                                                                        });
                                                                                    });
github ging / ediphy / doc / scripts / bringtodist.js View on Github external
const path = require('path');
const fs = require('fs');
const ncp = require("ncp").ncp;

const origPath = path.join('.', 'dist/lib');
const dstPath = path.join('.', 'doc/dist/demo/lib');
ncp.limit = 0;

const mkdirSync = function(dirPath) {
    try {
        fs.mkdirSync(dirPath);
    } catch (err) {
        if (err.code !== 'EEXIST') {throw err;}
    }
};

mkdirSync(dstPath);
ncp(origPath, dstPath, function(err) {
    if (err) {
        // eslint-disable-next-line no-console
        return console.error(err);
    }
github imolorhe / altair / packages / altair-static / scripts / prepare_dist.js View on Github external
const ncp = require('ncp').ncp;
const path = require('path');
const fs = require('fs');

ncp.limit = 16;

const deleteFolderRecursive = function(path) {
  if (fs.existsSync(path)) {
    fs.readdirSync(path).forEach(function(file, index){
      var curPath = path + "/" + file;
      if (fs.lstatSync(curPath).isDirectory()) { // recurse
        deleteFolderRecursive(curPath);
      } else { // delete file
        fs.unlinkSync(curPath);
      }
    });
    fs.rmdirSync(path);
  }
};

const distSrc = path.join(__dirname, '../../../dist'); // From the main altair dist folder
github bthorben / pdfRepo / reporter.js View on Github external
var http = require('http');
var fs = require("fs");
var util = require('./util/util.js');
var mongo = require("mongodb");
var dust = require("dustjs-linkedin");
var ncp = require("ncp").ncp;
    ncp.limit = 16;
var report = require("./core/report.js");
var inspect = require("util").inspect;

var STATIC_CONTENT = "webpage_static/";
var VIEWS_PATH = "webpage_views/";

var arguments = process.argv.slice(2);
if (arguments.length < 2) {
  console.log("Usage: folder_to_output_in versions");
  console.log("First given version is treated as latest");
  process.exit();
}
var outputFolder = arguments[0];
var histogramVersions = arguments[1].split(",");
var latestVersion = histogramVersions[0];
github ThomasG77 / turf-ol3 / node_modules / gitbook-plugin-mydemosamples / index.js View on Github external
var ncp = require('ncp').ncp;
var fs = require('fs');
var path = require('path');
ncp.limit = 16;

module.exports = {
    book: {
        assets: "./book",
        js: [
            "test.js"
        ],
        css: [
            "test.css"
        ]
    },
    hooks: {
        init: function() {
            console.log("init!");
        },
        finish: function() {
github logicalparadox / codex / lib / codex.back.js View on Github external
var drip = require('drip')
  , _ = require('./_')
  , md = require( "markdown" ).markdown.toHTML
  , fs = require('fs')
  , ncp = require('ncp').ncp
  , path = require('path')
  , jade = require('jade')
  , stylus = require('stylus')
  , yaml = require('yaml')
  , dox = require('dox');

var exports = module.exports = Codex;

exports.version = '0.0.6';

ncp.limit = 16;

function Codex (inDir, outDir) {
  drip.call(this);
  this.inDir = inDir;
  this.outDir = outDir;
  this.files = [];
  this.code = [];
  this.locals = {
    files: {},
    site: {}
  };
}

Codex.prototype.__proto__ = drip.prototype;

Codex.parseMarkdown = function (markdown) {
github bluekvirus / Stage.js / tools / libprep / run.js View on Github external
*
 * @author Tim Lauv
 * @updated 2016.12.30
 * 
 */

var buildify = require('buildify'),
path = require('path'),
fs = require('fs-extra'),
os = require('os'),
ncp = require('ncp').ncp,
colors = require('colors'),
_ = require('underscore');
_.str = require('underscore.string');

ncp.limit = 16;

/*!!!!!Change this if .bowerrc changes!!!!!*/
var implFolder = '../../implementation',
distFolder = path.join(implFolder, 'js', 'lib'),
libBase = path.join(implFolder, 'bower_components'),
themeBase = path.join(implFolder, 'themes');


buildify.task({
	name: 'fix-libs',
	depends: ['uri-js', 'jquery-color', 'jquery-file-upload', 'jquery-ui', /*'fake', 'min'*/],
	task: function(){}
});

/**
 * =======================================

ncp

Asynchronous recursive file copy utility.

MIT
Latest version published 10 years ago

Package Health Score

72 / 100
Full package analysis