download.js 295 B

123456789101112
  1. import fs from 'fs'
  2. import { download } from 'libphonenumber-metadata-generator'
  3. const url = process.argv[2]
  4. const outputPath = process.argv[3]
  5. download(url).then((contents) => {
  6. fs.writeFileSync(outputPath, contents)
  7. }).catch((error) => {
  8. console.error(error)
  9. process.exit(1)
  10. })