index.js
function main(args) {
  return new Promise((resolve, reject) => {
    let b = browserifyArgs(['--node', '--no-detect-globals'].concat(args));
    let outdir = (b.argv.outdir || b.argv.o);
    if (b.argv._[0] === 'help' || b.argv.h || b.argv.help ||
      (process.argv.length <= 2 && process.stdin.isTTY)) {
      reject(new Error('Usage: collect-js-deps --outdir <path> [--list] ' +
        '{BROWSERIFY-OPTIONS} [entry files]'));
      return;
    }
    if (!outdir && !b.argv.list) {
      reject(new Error('collect-js-deps requires --outdir (-o) option for output directory, or --list'));
      return;
    }
    collect_js_deps(b, { list: b.argv.list, outdir });
    b.bundle((err, body) => err ? reject(err) : resolve());
  });
}
function main(args) {
  return new Promise((resolve, reject) => {
    let b = browserifyArgs(['--node', '--no-detect-globals'].concat(args));
    let outdir = (b.argv.outdir || b.argv.o);
    if (b.argv._[0] === 'help' || b.argv.h || b.argv.help ||
      (process.argv.length <= 2 && process.stdin.isTTY)) {
      reject(new Error('Usage: collect-js-deps --outdir <path> [--list] ' +
        '{BROWSERIFY-OPTIONS} [entry files]'));
      return;
    }
    if (!outdir && !b.argv.list) {
      reject(new Error('collect-js-deps requires --outdir (-o) option for output directory, or --list'));
      return;
    }
    collect_js_deps(b, { list: b.argv.list, outdir });
    b.bundle((err, body) => err ? reject(err) : resolve());
  });
}
function main ( args ) { return new Promise ( ( resolve , reject ) => { let b = browserifyArgs ( [ '--node' , '--no-detect-globals' ] . concat ( args ) ) ; let outdir = ( b . argv . outdir || b . argv . o ) ; if ( b . argv . _ [ 0 ] === 'help' || b . argv . h || b . argv . help || ( process . argv . length <= 2 && process . stdin . isTTY ) ) { reject ( new Error ( 'Usage: collect-js-deps --outdir <path> [--list] ' + '{BROWSERIFY-OPTIONS} [entry files]' ) ) ; return ; } if ( ! outdir && ! b . argv . list ) { reject ( new Error ( 'collect-js-deps requires --outdir (-o) option for output directory, or --list' ) ) ; return ; } collect_js_deps ( b , { list : b . argv . list , outdir } ) ; b . bundle ( ( err , body ) => err ? reject ( err ) : resolve ( ) ) ; } ) ; }
Command-line interface to collect_js_deps. Takes an array of arguments as may be passed to
collect-js-deps on the command-line.
@returns Promise resolved on success, rejected on error.
Command - line interface to collect_js_deps . Takes an array of arguments as may be passed to collect - js - deps on the command - line .