Command-line Weather app using OpenStreet Map and DarkSky.net API.
Before you start using this weather app, you have to create an external file variables.env
with darksky.net
API key stored in it. Here are the steps:
- Create an external file
variables.env
OR just renamevariables.env.example
tovariables.env
. - Goto https://darksky.net/dev and sign up for API key.
- In
variables.env
file, insert the API key in the following format
API_KEY="YOUR_API_KEY"
Substitute YOUR_API_KEY
with the API key you received from the previous step.
node app.js --address="YOUR_ADDRESS"
Set a default address so that you don't have to explicitly specify address on every app execution.
node app.js --setdefault="YOUR_DEFAULT_ADDRESS"
After setting the default address, you can simply run node app.js
to view the weather of the default address.
node app.js --help