Socket
Socket
Sign inDemoInstall

metaweather

Package Overview
Dependencies
21
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    metaweather

Promise based metaweather API module


Version published
Weekly downloads
2
Maintainers
1
Created
Weekly downloads
 

Readme

Source

metaweather

Promise based npm module for using metaweather API


Install

$ npm install --save metaweather

Usage

var MetaWeather = require('metaweather');

var mw = new MetaWeather;

// Use string query to location info and woeid
mw.search().query('san fran').then(function(response) {
    console.log(response.body);
});

// Search locations nearby with Lat/Lon
// …as string:
mw.search().latLon('37.777119, -122.41964').then(function(response) {
    console.log(response.body);
});

// …or object:
mw.search().latLon({lat: 37.777119, lon: -122.41964}).then(function(response) {
    console.log(response.body);
});

// Get current location weather data with woeid
mw.location(2487956).then(function(response) {
    console.log(response.body);
});

// Get location weather from a specific date
// …as string:
mw.location(2487956, '2017-04-05').then(function(response) {
    console.log(response.body);
});

// …or object:
mw.location({woeid: 2487956, date: '2017/04/05'}).then(function(response) {
    console.log(response.body);
});

API Methods

.search().query(queryString)
.search().latLon(queryString)
.search().latLon({lat, lon})
.location(woeid) // 2487956
.location(woeid, dateString) // 2017/04/12 or 2017-04-12
.location({woeid, dateString}) {woeid: 2487956, date: '2017/04/12'}

About Metaweather

MetaWeather is an automated weather data aggregator that takes the weather predictions from various forecasters and calculates the most likely outcome. The thinking is that the combined knowledge of the forecasters will produce a better prediction. Read more about MetaWeather

Keywords

FAQs

Last updated on 04 Aug 2017

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