wili 0.5.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.de.md CHANGED
@@ -6,15 +6,11 @@
6
6
 
7
7
  [English](README.md) | **Deutsch**
8
8
 
9
- Node Wrapper für das Echtzeitdaten API der Wiener Linien
9
+ Node Wrapper für die Echtzeitdaten-API der Wiener Linien
10
10
 
11
11
  ## Installation
12
12
 
13
- `yarn add wili || npm install wili`
14
-
15
- ## Voraussetzungen
16
-
17
- **Hinweis:** Seit November 2019 wird kein gültiger API Key mehr für die Verwendung benötigt. Zuvor erworbene Keys können weiterhin verwendet werden.
13
+ `npm install wili`
18
14
 
19
15
  ## Anwendung
20
16
 
@@ -40,13 +36,24 @@ wili.trafficInfoList(options)
40
36
 
41
37
  // async/await
42
38
  try {
43
- let data = await wili.trafficInfoList(options);
39
+ const data = await wili.trafficInfoList(options);
44
40
  console.log(data.trafficInfos);
45
41
  } catch (output) {
46
42
  console.error(error);
47
43
  }
48
44
  ```
49
45
 
46
+ :warning: Für NodeJS-Versionen unterhalb v18, muss die Klasse mit einer `fetch`-Implementierung instanziert werden.
47
+
48
+ **Beispiel**
49
+
50
+ ```js
51
+ import { WienerLinien } from 'wili';
52
+ import fetch from 'isomorphic-fetch';
53
+
54
+ const wili = new WienerLinien(fetch);
55
+ ```
56
+
50
57
  ## API
51
58
 
52
59
  ### monitor
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm](https://flat.badgen.net/npm/license/wili)](https://www.npmjs.org/package/wili)
4
4
  [![npm](https://flat.badgen.net/npm/v/wili)](https://www.npmjs.org/package/wili)
5
- [![CI](https://img.shields.io/github/workflow/status/idleberg/node-wili/CI?style=flat-square)](https://github.com/idleberg/node-wili/actions)
5
+ [![CI](https://img.shields.io/github/actions/workflow/status/idleberg/node-wili/default.yml?style=flat-square)](https://github.com/idleberg/node-wili/actions)
6
6
 
7
7
  **English** | [Deutsch](README.de.md)
8
8
 
@@ -10,11 +10,7 @@ A Node wrapper for the Wiener Linien public transport API
10
10
 
11
11
  ## Installation
12
12
 
13
- `yarn add wili || npm install wili`
14
-
15
- ## Prerequisites
16
-
17
- **Note:** As of November 2019, a valid API key to access Wiener Linien's real-time data is no longer required. However, if you obtained a key before, you can continue using it.
13
+ `npm install wili`
18
14
 
19
15
  ## Usage
20
16
 
@@ -40,13 +36,24 @@ wili.trafficInfoList(options)
40
36
 
41
37
  // async/await
42
38
  try {
43
- let data = await wili.trafficInfoList(options);
39
+ const data = await wili.trafficInfoList(options);
44
40
  console.log(data.trafficInfos);
45
41
  } catch (output) {
46
42
  console.error(error);
47
43
  }
48
44
  ```
49
45
 
46
+ :warning: For NodeJS versions lower than v18, the class needs to be instantiated with a `fetch`-implementation
47
+
48
+ **Example**
49
+
50
+ ```js
51
+ import { WienerLinien } from 'wili';
52
+ import fetch from 'isomorphic-fetch';
53
+
54
+ const wili = new WienerLinien(fetch);
55
+ ```
56
+
50
57
  ## API
51
58
 
52
59
  ### monitor