Socket
Socket
Sign inDemoInstall

fpti

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fpti

Standardized API for public transportation client libraries.


Version published
Weekly downloads
7
decreased by-30%
Maintainers
1
Install size
38.7 kB
Created
Weekly downloads
 

Readme

Source

fpti-js

FPTI-JS (Friendly Public Transport Interface) describes a standardized API for public transportation client libraries in JavaScript. See the spec and the list of JS modules.

Proposal, work in progress!

npm version license chat on gitter

API

The purpose of this specification is to outline a standardized API for the most common features of public transportation libraries, such as Journey planning, Departures/Arrivals or Station search. While most libraries certainly don't cover all of the following features, the basic principle for modules complying to fpti-js is that if a certain feature is available, it must be provided with the API described below. Some modules may also include additional functionalities that are not covered within this specification, as long as they don't use the reserved fpti-js method names.

Furthermore, even for additional features that are not covered within the following spec, fpti-js modules return data in the Friendly Public Transport Format v1.x.x wherever possible and use validate-fptf and fpti-tests in their tests.

Method overview

All methods expose an object method.features which contains all supported options and simple descriptions of those options as keys and values, respectively. See the method specifications for examples.

MethodFeature descriptionReturns
stations.all([opt]) / stops.all([opt]) / regions.all([opt])All stations/stops/regions of the network.Readablestation / stop / region
stations.search(query, [opt]) / stops.search(query, [opt]) / regions.search(query, [opt])Search stations/stops/regions by query.Promise[station] / [stop] / [region]
stations.nearby(location, [opt]) / stops.nearby(location, [opt]) / regions.nearby(location, [opt])Search stations/stops/regions by location.Promise[station] / [stop] / [region]
journeys(origin, destination, [opt])Journeys between stations (or optionally other locations)Promise[journey]
stopovers(station, [opt])Departures and arrivals at a given station (or optionally other location)Promise[stopover]

Contributing

We are looking forward to discuss & extend this format further! If you have a question or want to propose changes, visit the issues page. Keep our contributing guidelines in mind. Note that, by participating in this project, you commit to the code of conduct.

Keywords

FAQs

Last updated on 29 Aug 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc