UNPKG

1.27 kBMarkdownView Raw
1[![install size](https://packagephobia.now.sh/badge?p=weather)](https://packagephobia.now.sh/result?p=weather)
2
3# node-weather
4Weather is a node module that makes it easy to get the weather for anywhere in the world.
5
6## Install
7You can install Weather from npm or yarn:
8```
9npm install weather
10yarn add weather
11```
12
13## Getting started
14Weather 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
17Click [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
20Here's a quick example of getting the weather for Brisbane, Australia:
21```js
22const Weather = require('weather');
23
24const appID = ''; // here.com appID
25const appCode = ''; // here.com appCode
26
27const weather = new Weather({
28 appID,
29 appCode
30});
31
32// now(<location>) returns a Promise
33weather.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