mav-stations

0.3.1 • Public • Published

mav-stations

A collection of all* stations of Magyar Államvasutak (MÁV, Hungarian State Railways), requested from an endpoint used by their website.

(* All stations that would appear when using the MAV website. This excludes internally used stations or sub-stations like "München Hbf Gl.5-10" with ID "008069685".)

npm version ISC-licensed

Installing

npm install mav-stations

Note: This Git repo does not contain the data, but the npm package does.

Usage

readStations() returns a readable stream in object mode, emitting Friendly Public Transport Format station objects.

import { readStations } from 'mav-stations';

for await (const station of readStations()) {
  console.log(station);
}
{
  type: 'station',
  id: '005510009', // EVA-like number
  name: 'BUDAPEST*',
  aliasNames: ['Bp (BUDAPEST*)'], // if several names for the same station exist
  baseCode: '3638', // only defined on Hungarian stations
  isInternational: false, // true if international trains available (?)
  canUseForOfferRequest: true,
  canUseForPassengerInformation: false,
  country: 'Hungary',
  countryIso: 'HU',
  isIn108_1: true, // apparently only true for select Hungarian stations; "internationalCapable"
  transportMode: {"code": 100,"name": "Rail", "description": "Rail. Used for intercity or long-distance travel."}
}
// and a lot more…

Related

Contributing

If you have a question, found a bug or want to propose a feature, have a look at the issues page.

Package Sidebar

Install

npm i mav-stations

Weekly Downloads

1

Version

0.3.1

License

ISC

Unpacked Size

4.13 MB

Total Files

8

Last publish

Collaborators

  • martinlangbecker