sw

simple-weather

Simple Interface for Open Weather Map API

Showing:

Popularity

Downloads/wk

9

Maintenance

No Maintenance Data Available

Package

Dependencies

4

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

NPM

Simple Weather

Simple Interface for Open Weather API

Installation

npm install simple-weather

Usage

var config = {
    units: "imperial",
    debug: process.env.NODE_ENV === 'development'
};

// Create the simpleWeather base object
//  - pass in an optional config object
var simpleWeather = require("simple-weather")(config);

// Get the current weather of London, UK for Open Weather API v2.5
simpleWeather["v2.5"].current.byCityName("London", "uk").then(function(response) {
    console.log("Current Weather of London, UK is");
    console.log("Temperature:", response.main.temp, "Farenheit");
}).catch(function(err) {
    console.error(err.stack);
});

Configuration

apiKey (String)

units (String)

  • Measurement units to return all data
  • kelvin (default), metric (Celsius), imperial (Farenheit)
  • Optional

mode (String)

  • Data return format
  • json (default), xml, html
  • Optional

debug (Boolean)

  • Handles debug options of the program. (i.e. logging the api url a request was made for).
  • Optional

Change Log

  • 1.2.2

    • Updating package.json keywords and description to more meaningful values
  • 1.2.1

    • Update README.md documentation for configuration parameters
  • 1.2.0

    • api v2.5 current weather functionality for [byCityId]
    • api v2.5 current weather functionality for [byCityIds]
    • api v2.5 current weather functionality for [byGeoLocation]
    • api v2.5 current weather functionality for [byZipcode]
    • api mode support for xml and html
  • 1.1.0

    • Add debug configuration and associated request url logging

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial