wheather
v5.0.1
Published
Retrieve the temperature (in celcius) of any city
Downloads
10
Readme
Weather
Give the weather for any given city.
Usage
Directly from the command line:
$ API_KEY=<openweathermap api key> node index.js <city>
As a library:
const getWeather = require('wheather')
// ...
getWheather(process.env.API_KEY, process.argv[2])
.then(cityTemperature => {
// do something with the temperature
})
Features
- Call a remote API (hint: npmjs.com/package/got)
- Provide the API Key using varenv (hint: process.env)
- Display temperature in celsius
- Fail if API Key is missing
- Print the weather for a given city
- Pass city using command line parameter
- Publish as npm package
- Make the script as a function
- Expose API endpoint taking a city as argument