index.js
function run(argv, done) {
  if (!argv) {
    argv = parser.argv;
  }

  if (argv.h) {
    parser.showHelp();
    return done(null);
  }

  if (!argv._.length) {
    return done(new Error('Requires an input argument'));
  } else if (argv._.length > 2) {
    return done(new Error('Too many arguments given!'));
  }

  var input = argv._[0];
  if (input.indexOf('http://') === 0 || input.indexOf('https://') === 0) {
    request(input, function (err, res, body) {
      if (err) {
        return done(err);
      }
      convert(body, done);
    });
  } else {
    if (!fs.existsSync(input)) {
      return done(new Error('`' + input + '` does not exist!'));
    }

    fs.readFile(input, 'utf-8', function (err, content) {
      if (err) {
        return done(err);
      }

      convert(content, done);
    });
  }
}
function run(argv, done) {
  if (!argv) {
    argv = parser.argv;
  }

  if (argv.h) {
    parser.showHelp();
    return done(null);
  }

  if (!argv._.length) {
    return done(new Error('Requires an input argument'));
  } else if (argv._.length > 2) {
    return done(new Error('Too many arguments given!'));
  }

  var input = argv._[0];
  if (input.indexOf('http://') === 0 || input.indexOf('https://') === 0) {
    request(input, function (err, res, body) {
      if (err) {
        return done(err);
      }
      convert(body, done);
    });
  } else {
    if (!fs.existsSync(input)) {
      return done(new Error('`' + input + '` does not exist!'));
    }

    fs.readFile(input, 'utf-8', function (err, content) {
      if (err) {
        return done(err);
      }

      convert(content, done);
    });
  }
}
function run ( argv , done ) { if ( ! argv ) { argv = parser . argv ; } if ( argv . h ) { parser . showHelp ( ) ; return done ( null ) ; } if ( ! argv . _ . length ) { return done ( new Error ( 'Requires an input argument' ) ) ; } else if ( argv . _ . length > 2 ) { return done ( new Error ( 'Too many arguments given!' ) ) ; } var input = argv . _ [ 0 ] ; if ( input . indexOf ( 'http://' ) === 0 || input . indexOf ( 'https://' ) === 0 ) { request ( input , function ( err , res , body ) { if ( err ) { return done ( err ) ; } convert ( body , done ) ; } ) ; } else { if ( ! fs . existsSync ( input ) ) { return done ( new Error ( '`' + input + '` does not exist!' ) ) ; } fs . readFile ( input , 'utf-8' , function ( err , content ) { if ( err ) { return done ( err ) ; } convert ( content , done ) ; } ) ; } }
Run the command with the given arguments.
Run the command with the given arguments .