Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lionralfs/hvv
🚇 Node.js wrapper for the HVV API
https://github.com/lionralfs/hvv
api-wrapper hvv javascript nodejs public-transportation
Last synced: 3 days ago
JSON representation
🚇 Node.js wrapper for the HVV API
- Host: GitHub
- URL: https://github.com/lionralfs/hvv
- Owner: lionralfs
- License: mit
- Created: 2018-01-09T13:08:27.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-01-24T09:52:35.000Z (about 3 years ago)
- Last Synced: 2024-03-29T12:46:33.740Z (10 months ago)
- Topics: api-wrapper, hvv, javascript, nodejs, public-transportation
- Language: TypeScript
- Homepage:
- Size: 136 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> 🏗 This project is under development!
# Node.js API-wrapper for Public Transport in Hamburg
[![Build Status][build-badge]][build]
[![version][version-badge]][package]
[![MIT License][license-badge]][license]## Installation
```bash
npm install hvv
```## Usage
```js
import { HVVClient } from 'hvv';const hvv = new HVVClient({
key: 'secret',
user: 'user'
});hvv.getRoute({ start: { name: '...' }, dest: { name: '...' } }).then(result => console.log(result));
```## Documentation
### HVVClientOptions
You can initialize a new instance by calling `new HVVClient(HVVClientOptions)`. `HVVClientOptions` is an object with the following properties:
#### user
_Required_
Type: `string`Represents `geofox-auth-user` header, provided by HBT GmbH.
#### key
_Required_
Type: `string`Individual password, provided by HBT GmbH.
#### host
Type: `string`
Default: `http://api-test.geofox.de`The API Host address.
#### contentType
Type: `string`
Value: `application/json` or `application/xml`
Default: `application/json`The `Content-Type` HTTP-Header.
#### acceptEncoding
Type: `string`
Value: `gzip` or `deflate`
Default: no compression`Accept-Encoding` HTTP-Header.
#### accept
Type: `string`
Value: `application/json` or `application/xml`
Default: `application/json``Accept` HTTP-Header.
#### platform
Type: `string`
Value: One of the following:* ios (for iOS Apps)
* android (for Android Apps)
* winphone (for Windows Phone Apps)
* web (for desktop websites)
* mobile (for mobile websites)Default: platform not specified
Represents the clients platform.
#### version
Type: `number`
Pins a specific API version to use in every request.
Can be overwritten in specific requests by using the `version`
parameter of a `BaseRequest`.Default: 1 (it's advised to supply a version here, since version 1
is quite old)### Methods
##### [init(InitRequest)](docs/init.md)
##### [checkName(CNRequest)](docs/checkname.md)
##### [getRoute(GRRequest)](docs/getroute.md)
##### [departureList(DLRequest)](docs/departurelist.md)
##### [getTariff()](docs/gettariff.md)
##### [departureCourse()](docs/departurecourse.md)
##### [listStations(LSRequest, LSCustomOptions)](docs/liststations.md)
##### [listLines()](docs/listlines.md)
##### [getAnnouncements(AnnouncementRequest)](docs/getannouncements.md)
##### [checkPostalCode()](docs/checkpostalcode.md)
##### [getVehicleMap()](docs/getvehiclemap.md)
##### [getTrackCoordinates()](docs/gettrackcoordinates.md)
##### [getIndividualRoute()](docs/getindividualroute.md)
##### [getStationInformation()](docs/getstationinformation.md)
## License
[MIT](LICENSE) © Lion Ralfs
[version-badge]: https://img.shields.io/npm/v/hvv.svg
[package]: https://www.npmjs.com/package/hvv
[license-badge]: https://img.shields.io/npm/l/hvv.svg
[license]: https://github.com/lionralfs/hvv/blob/master/LICENSE
[build]: https://travis-ci.org/lionralfs/hvv
[build-badge]: https://travis-ci.org/lionralfs/hvv.svg?branch=master