How to use the co-fs.exists function in co-fs

To help you get started, we’ve selected a few co-fs 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 setpixel / storyboard-fountain / node-webkit-src / js / localsource.js View on Github external
co(function *() {
      var dataPath = getFullDataPath() + '/images';
      return (
        (yield cofs.exists(dataPath)) && 
        (yield cofs.stat(dataPath)).isDirectory()
      );
    })(next);
  };
github setpixel / storyboard-fountain / node-webkit-src / js / localsource.js View on Github external
var makeDataPath = function *(basepath, name) {
    var alt = '';
    while (true) {
      var path = basepath + '/' + name + alt + '_data';
      if (yield cofs.exists(path)) {
        alt = '_' + shortId.generate();
      }
      else {
        yield cofs.mkdir(path);
        yield cofs.mkdir(path + '/images');
        return './' + name + alt + '_data';
      }
    }
  };
github Deathspike / mangarack / src / cli / mirror.js View on Github external
function *ensure(pathToBook) {
    var pathToDirectory = path.dirname(pathToBook);
    if (!(yield fs.exists(pathToDirectory))) {
        yield fs.mkdir(pathToDirectory);
    }
}

co-fs

fs wrappers for 'co'

MIT
Latest version published 10 years ago

Package Health Score

48 / 100
Full package analysis

Popular co-fs functions