How to use the mkdirp.mkdirpAsync function in mkdirp

To help you get started, we’ve selected a few mkdirp 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 t4t5 / november-cli / actions / generate-model.js View on Github external
.then(function() {
      return mkdirp.mkdirpAsync(nov.novemberDir() + 'app/controllers/' + modelFolderName)
    })
    // Add all the CRUD-actions for the model
github elastic / libesvm / lib / download.js View on Github external
var downloadAndInstall = function (log, options, version, cb) {
  var path = join(options.directory, version);
  var response = { path: path, version: version };
  return mkdirp.mkdirpAsync(options.directory).then(function (arg) {
    return fs.statAsync(path).then(function () {
      return response; 
    }); 
  })
  .catch(function (err) {
    if (err.cause && err.cause.code === 'ENOENT')  {
      return new Promises(function (resolve, reject) {
        log('INFO', 'Downloading & Installing ' + version);
        var gunzip = zlib.createGunzip();
        var url = 'https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-' + version + '.tar.gz';
          var out = tar.Extract({ path: path, strip: 1 });
        out.on('close', function () {
          resolve(response); 
        }).on('error', reject);
        request.get(url)
        .pipe(gunzip)
github internalfx / quickshot / src / blogs / download.es6 View on Github external
yield asyncEach(articles, function *(article, jdx) {
      let key = `blogs/${blog.handle}/${article.id}/article.json`

      yield mkdirp.mkdirpAsync(path.dirname(key))
      yield fs.writeFileAsync(key, JSON.stringify(article))

      var metafields = yield helpers.shopifyRequestAsync({
        method: 'get',
        url: `https://${target.api_key}:${target.password}@${target.domain}.myshopify.com/admin/articles/${article.id}/metafields.json`
      })
      metafields = metafields[1].metafields

      yield fs.writeFileAsync(`blogs/${blog.handle}/${article.id}/metafields.json`, JSON.stringify(metafields))
    })
github eclipse / upm / doxy / node / docgen.js View on Github external
Promise.all(_.map(formats, function(format) {
    var generateDocs = require(__dirname + '/generators/' + format + '/generator');
    var dir = opts.outdir + '/' + format + '/' + specjs.MODULE;
    return mkdirp.mkdirpAsync(dir).then(function() {
      return fs.writeFileAsync(dir + '/doc.js', generateDocs(specjs));
    });
  }));
});

mkdirp

Recursively mkdir, like `mkdir -p`

MIT
Latest version published 2 years ago

Package Health Score

67 / 100
Full package analysis