Socket
Socket
Sign inDemoInstall

weatherman.io

Package Overview
Dependencies
48
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    weatherman.io

A Node.js module for the Forecast.io API


Version published
Weekly downloads
11
increased by1000%
Maintainers
1
Install size
4.18 MB
Created
Weekly downloads
 

Readme

Source

Install it

 npm install weatherman.io

Require it

var weatherman = require( "weatherman.io" );

Create a weatherman

var alRoker = new weatherman( "your-forecast-io-api-key" );

Create a weatherman with options

var options = {
    units: "uk",
    exclude: ["minutely", "alerts"],
    extend: "hourly"
};

var alRoker = new weatherman( "your-forecast-io-api-key", options );

Detailed information about each of these options is available in the Forecast.io developer docs: https://developer.forecast.io/docs/v2

Do the forecast from a location

var forecastOptions = {
    latitude: 41.8854710,
    longitude: -87.6430260
};

alRoker.doForecast( forecastOptions, function ( err, weatherReport ) {

    if ( err ) {
        // handle any errors
    }
    // do something with the weatherReport

} );

Do the forecast for a specific time (Unix timestamp)

var forecastOptions = {
    latitude: 41.8854710,
    longitude: -87.6430260,
    time: 1395347280
};

alRoker.doForecast( forecastOptions, function ( err, weatherReport ) {

    if ( err ) {
        // handle any errors
    }
    // do something with the weatherReport

} );

Keywords

FAQs

Last updated on 07 Feb 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc