Search stations/stops/regions by query.
Non-empty string
.
Required
options are supported by every module. For non-required
options, the main FPTI principle still applies: If a certain feature/option is available, it must be provided as described below.
Note that modules might provide additional options as long as they don't use reserved option attributes.
Attribute | Description | Required | Value type | Default |
---|---|---|---|---|
results |
Max. number of results returned | ✅ | Number |
null |
The features
object would look like this for a module which only supports the required options:
{
results: 'Max. number of results returned'
// additionalOption: 'description of this option'
}
Returns a Promise
that resolves in an Array
of station
/ stop
/ region
FPTF@1 objects.
const module = require('fpti-module')
const matchingStations = module.stations.search('Paris Montparnasse')
const matchingStops = module.stops.search('Stadtmitte U2')
const matchingRegions = module.regions.search('Paris', {moduleSpecificOption: 'value'})
matchingStations.then(data => {
// data is an array of FPTF station objects
console.log(data)
})
console.log(module.stations.search.features) // all options