Skip to content

NWS-Current-Temperature is a library that provides functionality to obtain the current temperature in a location using zip code, city name, or address within the United States.

License

Notifications You must be signed in to change notification settings

jennyfofenny/nws-current-temperature

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nws-current-temperature

NWS-Current-Temperature is a library that provides functionality to obtain the current temperature in a location using zip code, city name, or address within the United States. It uses the Google Geocoding Service, as well as the NWS Forecast Pages. You will need to configure a Google API key for your application to use the library.

npm package

Build Status Dependency Status Known Vulnerabilities XO code style

Installation

Use npm to install the nws-current-temperature library:

npm install nws-current-temperature --save

Configuration

Use the Google API Console to create an API key for your application and update the value of the geocodingApiKey field in the config.json file located in node_modules/nws-current-temperature. Additionally, set the nwsUserAgent to the name of your application. Finally, the temperatureDecimalPrecision can be changed to adjust the precision of the temperature that is returned from the library.

Usage

nws-current-temperature can be included as a reference in your Node.js application.

const nwsCurrentTemperature = require('nws-current-temperature');

const location = 'Austin, TX';
nwsCurrentTemperature.getTemperatureFor(location, temperature => {
  console.log(location + ': ' + temperature + '°F');
});

License

MIT © Jennifer Rogers

About

NWS-Current-Temperature is a library that provides functionality to obtain the current temperature in a location using zip code, city name, or address within the United States.

Resources

License

Stars

Watchers

Forks

Packages

No packages published