New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

wheather

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wheather

Retrieve the temperature (in celcius) of any city

latest
npmnpm
Version
5.0.1
Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 20 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts