🌐 Get lat and long coordinates from any street address, in your terminal
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.eslintrc
.gitignore
.travis.yml
README.md
cli.js
license
package-lock.json
package.json
test.js

README.md

🌐 getcoords-cli npm Build Status Known Vulnerabilities

Get lat and long coordinates from any address, in your terminal

getcoords-cli uses the Google Geocoding API to convert any address into geographic coordinates.

Install

$ npm install -g getcoords-cli

Local Installation

getcoords-cli is intended to be installed globally and run anywhere, but you can also install it locally in a project. Note that if you do this, you will only be able to run commands inside your local project directory.

With npx:

$ cd path/to/your/project
$ npm install getcoords-cli
$ npx getcoords "..."

Or, with npm scripts:

$ cd path/to/your/project
$ npm install getcoords-cli
// in package.json
"scripts": {
  "getcoords": "./node_modules/.bin/getcoords"
}
$ npm run getcoords "..."

API Key

In order to use the package globally, you must first obtain a Google API key and set process.env.GOOGLE_GEOCOORDS_API_KEY in your shell initialization file. Please visit the dev docs for instruction on how to obtain the key, and this Stack Exchange answer for instruction on how to add it to your shell.

Usage

$ getcoords --help

  Usage
    getcoords [address]

  Options
    --version Outputs the version

  Examples
    $ getcoords "Los Angeles, CA"
    34.0522342 -118.2436849

    $ getcoords "6801 Hollywood Blvd, Los Angeles, CA 90028"
    34.1022444 -118.3401679

Related

License

MIT © Melanie Seltzer