wheather

5.0.1 • Public • Published

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

/wheather/

    Package Sidebar

    Install

    npm i wheather

    Weekly Downloads

    16

    Version

    5.0.1

    License

    ISC

    Last publish

    Collaborators

    • simonrenoult