yr-cli
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": 07 // millimeters "cloudiness": 100 // percent "humidity": 955 // percent "temperature": 41 // celcius "wind": "speed": 52 // 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.