From bcddc49049715d754e8e746443dcfd7c04145921 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Sun, 17 Dec 2017 17:48:21 +0100 Subject: [PATCH] docs for DB profile --- p/db/readme.md | 21 +++++++++++++++++++++ readme.md | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 p/db/readme.md diff --git a/p/db/readme.md b/p/db/readme.md new file mode 100644 index 00000000..a94e57c0 --- /dev/null +++ b/p/db/readme.md @@ -0,0 +1,21 @@ +# DB profile for `hafas-client` + +[*Deutsche Bahn (DB)*](https://en.wikipedia.org/wiki/Deutsche_Bahn) is the largest German long-distance public transport company. This profile adds *DB*-specific customizations to `hafas-client`. + +## Usage + +```js +const createClient = require('hafas-client') +const dbProfile = require('hafas-client/p/db') + +// create a client with DB profile +const client = createClient(dbProfile) +``` + + +## Customisations + +- supports 1st and 2nd class with `journey()` +- supports [their loyalty cards](https://en.wikipedia.org/wiki/Deutsche_Bahn#Tickets) with `journey()` +- parses *DB*-specific products (such as *InterCity-Express*) +- exposes the cheapest ticket price for a `journey` diff --git a/readme.md b/readme.md index 0529081f..eaa16015 100644 --- a/readme.md +++ b/readme.md @@ -2,7 +2,7 @@ **A client for HAFAS public transport APIs**. Sort of like [public-transport-enabler](https://github.com/schildbach/public-transport-enabler), but with a smaller scope. It also [contains customisations](p) for the following transport networks: -- [Deutsche Bahn](https://en.wikipedia.org/wiki/Deutsche_Bahn) – [src at `p/db`](p/db/index.js) +- [Deutsche Bahn](https://en.wikipedia.org/wiki/Deutsche_Bahn) - [docs](p/db/readme.md) – [src](p/db/index.js) - [Berlin public transport](https://en.wikipedia.org/wiki/Verkehrsverbund_Berlin-Brandenburg) - [docs](p/vbb/readme.md) – [src](p/vbb/index.js) [![npm version](https://img.shields.io/npm/v/hafas-client.svg)](https://www.npmjs.com/package/hafas-client)