cli.js 393 B

12345678910111213141516171819
  1. #!/usr/bin/env node
  2. /* eslint-disable no-process-exit */
  3. var extract = require('./')
  4. var args = process.argv.slice(2)
  5. var source = args[0]
  6. var dest = args[1] || process.cwd()
  7. if (!source) {
  8. console.error('Usage: extract-zip foo.zip <targetDirectory>')
  9. process.exit(1)
  10. }
  11. extract(source, { dir: dest })
  12. .catch(function (err) {
  13. console.error('error!', err)
  14. process.exit(1)
  15. })