How to use the private/core.async function in private

To help you get started, we’ve selected a few private 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 seedjs / seed / lib / commands / install.js View on Github external
loadDescriptor: function(path, done) {
    var context = this,
        loadPackage;
        
    path = CORE.path.normalize(path);
    loadPackage = CORE.async(function() { 
      return require.packageFor(path); 
    });
        
    loadPackage(function(err, pkg) {
      if (err) return done(err);
      var ret = context.buildDescriptorFromPackage(pkg);
      context.addDescriptor(ret, true); // replace whatever is in cache
      return done(null, ret);
    });
  },
github seedjs / seed / lib / commands / install.js View on Github external
}, function(done) {
            var loadPackage = CORE.async(function() {
              return require.packageFor(desc.path);
            });
            
            loadPackage(function(err, pkg) {
              if (!err & !pkg) err = packageId  + ' is invalid';
              if (err) return done(err);
              context.source.install(pkg, function(err) {
                if (err) return done(err);
                if (desc.remote) {
                  desc.remote.cleanup(desc.path, CORE.err(done));
                } else return done();
              });
            });
          })(done);
        });