{"id":25856881,"url":"https://github.com/lukaskollmer/mvg-node","last_synced_at":"2025-03-01T18:28:35.311Z","repository":{"id":23157409,"uuid":"98107126","full_name":"lukaskollmer/mvg-node","owner":"lukaskollmer","description":"🚏🚍 NodeJS client for the Munich Public Transport System","archived":false,"fork":false,"pushed_at":"2023-03-01T02:49:33.000Z","size":115,"stargazers_count":10,"open_issues_count":4,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-15T08:10:43.930Z","etag":null,"topics":["munich","nodejs","public-transport"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lukaskollmer.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-23T15:26:29.000Z","updated_at":"2022-10-31T16:27:22.000Z","dependencies_parsed_at":"2023-01-13T22:51:03.544Z","dependency_job_id":null,"html_url":"https://github.com/lukaskollmer/mvg-node","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukaskollmer%2Fmvg-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukaskollmer%2Fmvg-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukaskollmer%2Fmvg-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukaskollmer%2Fmvg-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukaskollmer","download_url":"https://codeload.github.com/lukaskollmer/mvg-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241406872,"owners_count":19958052,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["munich","nodejs","public-transport"],"created_at":"2025-03-01T18:28:34.834Z","updated_at":"2025-03-01T18:28:35.294Z","avatar_url":"https://github.com/lukaskollmer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mvg-node\n\n\u003e NodeJS client for the Munich Public Transport System\n\n\n## Install\n\n```\n$ npm install mvg-node\n```\n\n\n## Usage\n\n### Getting departures\n\n```js\nconst mvg = require('mvg-node');\n\n(async () =\u003e {\n  let home = await mvg.getStation('Feldbergstr')\n\n  let departures = await mvg.getDepartures(home);\n  console.log(departures);\n})();\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eOutput\u003c/summary\u003e\n\n  ```\n  [ { departureTime: 1500923983000,\n      product: 'b',\n      label: '194',\n      destination: 'Trudering Bf.',\n      live: true,\n      lineBackgroundColor: '#0d5c70',\n      departureId: 325930522,\n      sev: false,\n      time: 2017-07-24T19:19:43.000Z },\n    { departureTime: 1500924014000,\n      product: 'b',\n      label: '192',\n      destination: 'Neuperlach Zentrum',\n      live: true,\n      lineBackgroundColor: '#0d5c70',\n      departureId: -120781808,\n      sev: false,\n      time: 2017-07-24T19:20:14.000Z },\n      ... ]\n  ```\n\u003c/details\u003e\n\n\n## API\n\n#### `async getStation(input) -\u003e object`\nFetch information about a specific station\n\n| Parameter | Description |\n| :-------- | :---------- |\n| `input`   | Either a `Number` (station ID) or a `String` (station name) |\n| **Returns** | An `Object` containing information about a specific station. This object can be passed to the other functions |\n\n#### `async getStations(input) -\u003e array`\nSearch stations by name\n\n| Parameter | Description |\n| :-------- | :---------- |\n| `name`   | The station name to search for |\n| **Returns** | An `Array` of object representing stations |\n\n#### `async allStations() -\u003e array`\nFetch all stations\n\n#### `async getDepartures(station) -\u003e array`\nLoad a specific station's upcoming departures\n\n| Parameter | Description |\n| :-------- | :---------- |\n| `station`   | Either a station object or a station id |\n| **Returns** | An `Array` of upcoming departures from that station |\n\n#### `async getRoute(start, destination, options) -\u003e array`\nGet routes between two stations\n\n| Parameter | Description |\n| :-------- | :---------- |\n| `start`   | The route's starting point (either a station object, or a station id (Number) or a station name (String) |\n| `destination`   | The route's destination (either a station object, or a station id (Number) or a station name (String) |\n| `options`   | Either a date object (the route's starting time) or some more options (`start`, `arrival`, `maxTravelTimeFootwayToStation`, `maxTravelTimeFootwayToDestination`) |\n| **Returns** | An `Array` of routes between the two stations |\n\n## CLI\n\n```\n$ npm install --global mvg-node\n```\n\u003cdetails\u003e\n  \u003csummary\u003eUsage\u003c/summary\u003e\n\n```\n$ mvg-node --help\n\n  NodeJS client for the Munich Public Transport System\n\n  Usage\n    $ mvg-node [input] \u003coptions\u003e\n\n  Commands\n     station      Get information about a specific station\n     departures   Get upcoming departures for a specific station.\n\n  Options\n     --all        By default, this shows the next 10 departures. Pass `--all` to get all upcoming departures\n\n\n  Examples\n    $ mvg-node station 953\n\n    $ mvg-node departures 'Hauptbahnhof'\n```\n\u003c/details\u003e\n\n### Get departures\n\n```bash\n$ mvg-node departures 'Hauptbahnhof'\n```\n\n```\nUpcoming departures for 'Hauptbahnhof':\n┌─────────┬────────────────────────────────────────┐\n│   ⏳    │                                        │\n├─────────┼────────────────────────────────────────┤\n│ 1 min   │ S8 Herrsching                          │\n├─────────┼────────────────────────────────────────┤\n│ 1 min   │ U5 Neuperlach Süd                      │\n├─────────┼────────────────────────────────────────┤\n│ 1 min   │ U1 Olympia - Einkaufszentrum           │\n├─────────┼────────────────────────────────────────┤\n│ 1 min   │ U1 Mangfallplatz                       │\n├─────────┼────────────────────────────────────────┤\n│ 2 min   │ U5 Laimer Platz                        │\n├─────────┼────────────────────────────────────────┤\n│ 2 min   │ Bus 58 Silberhornstraße                │\n├─────────┼────────────────────────────────────────┤\n│ 3 min   │ S7 Höhenkirchen-Siegertsbrunn          │\n├─────────┼────────────────────────────────────────┤\n│ 4 min   │ U2 Feldmoching                         │\n├─────────┼────────────────────────────────────────┤\n│ 4 min   │ Tram 16 Romanplatz                     │\n├─────────┼────────────────────────────────────────┤\n│ 4 min   │ U2 Messestadt Ost                      │\n└─────────┴────────────────────────────────────────┘\n```\n\n\n\n## License\n\nMIT © [Lukas Kollmer](https://lukaskollmer.me)\n\n`mvg-node` was inspired by [leftshift/python_mvg_api](https://github.com/leftshift/python_mvg_api)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukaskollmer%2Fmvg-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukaskollmer%2Fmvg-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukaskollmer%2Fmvg-node/lists"}