yr-cli
yr.no weather forecast CLI
Last updated 2 years ago by clux .
MIT · Repository · Bugs · Original npm · Tarball
$ cnpm install yr-cli 
SYNC missed versions from official npm registry.

yr-cli

npm status build status dependency status coverage status

Terminal json weather reports via the weather api from yr.no.

Usage

Create your .yrcli.json containing your location like in the example

yr # now
yr -h 16 # at 16:00
yr -d 1 -h 12 # tomorrow at 12:00
yr -f # 5 day forecast

Output is json. For quick usage you can pipe to json:

yr | json rain # amount of rain for the next hour
yr -f | json -a temperature # temperatures for next 5 days

Units

Here is an example output object annotated with the standard metric units (because we just return numbers):

{
  "from": "2015-12-31T15:00:00Z",
  "to": "2015-12-31T16:00:00Z",
  "rain": 0.7, // millimeters
  "cloudiness": 100, // percent
  "humidity": 95.5, // percent
  "temperature": 4.1, // celcius
  "wind": {
    "speed": 5.2, // meters per second
    "direction": 181 // degrees in direction of compass, e.g. 180 is straight south.
  }
}

The dates are UTC JSON date strings you can Date.parse().

Caching

In accordance with yr.no usage policies, data is cached in the cacheFile specified in your config for 10 minutes (which must be a .json file).

Installation

$ npm install yr-cli -g

License

MIT-Licensed. See LICENSE file for details.

Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 7
Dependencies (5)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |