hafas-rest-api-client
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -55,2 +55,3 @@ 'use strict' | ||
} | ||
// eslint-disable-next-line no-empty | ||
} catch (_) {} | ||
@@ -86,2 +87,9 @@ throw err | ||
const stations = async (query, opt = {}) => { | ||
return await request('/stations', { | ||
...opt, | ||
query, | ||
}) | ||
} | ||
const reachableFrom = async (loc, opt = {}) => { | ||
@@ -138,2 +146,3 @@ return await request('/stops/reachable-from', { | ||
nearby, | ||
stations, | ||
reachableFrom, | ||
@@ -140,0 +149,0 @@ stop, |
{ | ||
"name": "hafas-rest-api-client", | ||
"description": "An API client for hafas-rest-api endpoints.", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"type": "module", | ||
@@ -30,2 +30,3 @@ "main": "index.js", | ||
"devDependencies": { | ||
"eslint": "^8.24.0", | ||
"luxon": "^3.0.4", | ||
@@ -36,4 +37,5 @@ "tap-min": "^2.0.0", | ||
"scripts": { | ||
"lint": "eslint .", | ||
"test": "node test.js | tap-min", | ||
"prepublishOnly": "npm test" | ||
"prepublishOnly": "npm run lint && npm test" | ||
}, | ||
@@ -40,0 +42,0 @@ "contributors": [ |
@@ -32,3 +32,3 @@ # hafas-rest-api-client | ||
`hafas-rest-api-client` is a client [`hafas-rest-api@3`](https://www.npmjs.com/package/hafas-rest-api/v/3.4.0) APIs. Check their individual API docs for all supported parameters. | ||
`hafas-rest-api-client` is a client for [`hafas-rest-api@3`](https://www.npmjs.com/package/hafas-rest-api/v/3.8.0) APIs. Check their individual API docs for all supported parameters. | ||
@@ -38,4 +38,8 @@ The response objects have special [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) fields for meta information: | ||
```js | ||
const {HEADERS, SERVER_TIMING, CACHE} = require('hafas-rest-api-client') | ||
const { | ||
RESPONSE, HEADERS, | ||
SERVER_TIMING, CACHE, | ||
} = require('hafas-rest-api-client') | ||
console.log('response', res[RESPONSE]) // Fetch API Response object | ||
console.log('response headers', res[HEADERS]) // Fetch API Headers object | ||
@@ -42,0 +46,0 @@ console.log('server timing', res[SERVER_TIMING]) // value of the Server-Timing response header |
7615
140
52
4