1 | [![install size](https://packagephobia.now.sh/badge?p=weather)](https://packagephobia.now.sh/result?p=weather)
|
2 |
|
3 | # node-weather
|
4 | Weather is a node module that makes it easy to get the weather for anywhere in the world.
|
5 |
|
6 | ## Install
|
7 | You can install Weather from npm or yarn:
|
8 | ```
|
9 | npm install weather
|
10 | yarn add weather
|
11 | ```
|
12 |
|
13 | ## Getting started
|
14 | Weather uses the here.com weather API. You'll need an appID and appCode from here.com before using the Weather module. When you have them, import the module, and pass them through.
|
15 |
|
16 | ### Getting a here.com appID and appCode
|
17 | Click [here](https://developer.here.com/plans?create=Freemium-Basic&keepState=true&step=account) to create a free here.com account. Once finished and confirmed, get your appID and appCode.
|
18 |
|
19 | ### Example
|
20 | Here's a quick example of getting the weather for Brisbane, Australia:
|
21 | ```js
|
22 | const Weather = require('weather');
|
23 |
|
24 | const appID = ''; // here.com appID
|
25 | const appCode = ''; // here.com appCode
|
26 |
|
27 | const weather = new Weather({
|
28 | appID,
|
29 | appCode
|
30 | });
|
31 |
|
32 | // now(<location>) returns a Promise
|
33 | weather.now('Brisbane, Australia').then((results) => {
|
34 | console.log(results);
|
35 | });
|
36 | ```
|
37 |
|
38 | ## Licence
|
39 | (c) 2019 ThatTonybo. Licenced under the GNU GPL v3 license, do not modify and republish without explicit permission. |
\ | No newline at end of file |