Parse VBB lines like M4, TXL, S42.

Usage no npm install needed!

<script type="module">
  import vbbParseLine from 'https://cdn.skypack.dev/vbb-parse-line';



Parses the names of VBB lines like M4, TXL, S42.

npm version build status ISC-licensed chat on gitter support me on Patreon

Because this module tries to guess the mode of transport from line names, it is doomed to have conflicts. Right now, it is primarily focused on Berlin, until we have a more robust solution to find out more about lines.


npm install vbb-parse-line


const parse = require('vbb-parse-line')

This will return the following.

    mode: 'train',
    product: 'tram',
    symbol: 'M',
    nr: 4
    metro: true  // buses & trams that run frequently & all day
    express: false // buses that skip stations
    night: false // buses replacing other lines in the night


If you have a question or have difficulties using vbb-parse-line, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.