diff --git a/docs/departures.md b/docs/departures.md index e92583a7..509c6449 100644 --- a/docs/departures.md +++ b/docs/departures.md @@ -23,7 +23,6 @@ With `opt`, you can override the default options, which look like this: ```js { - // todo: products when: new Date(), direction: null, // only show departures heading to this station line: null, // filter by line ID @@ -41,6 +40,17 @@ With `opt`, you can override the default options, which look like this: } ``` +If you pass an object `opt.products`, its fields will partially override the default products defined in the profile. An example with the [BVG profile](../p/bvg): + +```js +const createClient = require('hafas-client') +const vbbProfile = require('hafas-client/p/vbb') +const client = createClient(vbbProfile, 'my-awesome-program') + +// will query with these products: suburban, subway, bus, express, regional +client.departures('900000024101', {products: {tram: false, ferry: false}}) +``` + ## Response *Note:* As stated in the [*Friendly Public Transport Format* `1.2.0`](https://github.com/public-transport/friendly-public-transport-format/tree/1.2.0), the `when` field includes the current delay. The `delay` field, if present, expresses how much the former differs from the schedule.