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

darksky-node

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

darksky-node

DarkSky API Client

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

darksky-node

NodeJS API client for Dark Sky API.

Install

$ npm install darksky-node --save

Configuration

You'll need a developer key for the Dark Sky API which can you can create here.

Usage

Create an instance of the Dark Sky API Client:

var DarkSky = require('darksky-node');

var darkSkyClient = new DarkSky('myApiKey');

Options

All methods take the same options object:

  • exclude: array containing any of: currently, minutely, hourly, daily, alerts, flags.
  • extend: pass hourly for hour-by-hour data for the next 168 hours, instead of the next 48.
  • lang: en or any other i18n
  • units: us, si, ca, uk2, auto

Methods

Once you have an instance of the API you can call any of the available methods

Forecast

A Forecast Request returns the current conditions, a minute-by-minute forecast for the next hour, an hour-by-hour forecast for the next 48 hours, and a day-by-day forecast for the next week.

darkSkyClient.forecast(latitude, longitude, options, function(err, forecast){
    if(err) console.error(err);
    else console.dir(forecast);
});

Time-Machine

A Time Machine Request returns the observed (in the past) or forecasted (in the future) hour-by-hour and daily weather conditions for a particular date.

darkSkyClient.timemachine(latitude, longitude, new Date(), options, function(err, forecast){
    if(err) console.error(err);
    else console.dir(forecast);
});

Keywords

FAQs

Package last updated on 26 Sep 2016

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