JSPM

geonames-postal-codes-import-nodejs

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q29071F
  • License MIT

Import Postal Codes from GeoNames.org into a database

Package Exports

  • geonames-postal-codes-import-nodejs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (geonames-postal-codes-import-nodejs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

geonames-postal-codes-import-nodejs

Using Node.js to import Postal Codes from GeoNames.org into a database. See http://download.geonames.org/export/zip/ for a complete list of available postal codes.

Currently, only mysql is supported. Please adapt functions dbConnect(), dbCreateTable(), dbDeleteTable() and dbInsert() in index.js to support other databases.

Unlike other tools, this tool only requires Node.js and no other libraries.

Installation

npm install geonames-postal-codes-import-nodejs

Usage

cd node_modules/geonames-postal-codes-import-nodejs
node index.js [options]

Options:

    -h, --help                 output usage information
    -V, --version              output the version number
    -h, --host [host]          DB Host
    -u, --user [user]          DB User
    -p, --password [password]  DB Password
    -d, --database [database]  DB Database
    -t, --table [table]        DB table
    -c, --countries <keys>     comma separated list of country codes

  Country Codes: <keys>

    see http://download.geonames.org/export/zip/

  Examples:

    index.js -h localhost -u root -p root123 -d geodb -t postal_codes -c DE,CH,ES
    index.js -h localhost -u root -p root123 -d geodb -t postal_codes -c allCountries