New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

simple-weather

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-weather

Simple Interface for Open Weather Map API

  • 1.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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)

  • OpenWeatherMap.org API_KEY
  • Create an account at http://openweathermap.org/
  • Optional
    • apiKey config parameter or OPEN_WEATHER_MAP_API_KEY environment variable. The config parameter takes precedence.

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

Keywords

FAQs

Package last updated on 08 Oct 2015

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc