npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

simplifyefa

v0.0.6

Published

Typescript/Javascript wrapper for EFA (Elektronische Fahrplanauskunft)

Downloads

55

Readme

SimplifyEFA

Installation

You can install using npm.

npm install simplifyefa

Endpoint

The EFA endpoint can be set when creating an instance of the SimplifyEfa class, the endpoint in the example below is set by default when you omit the parameter:

const simplifyEfa = new SimplifyEfa('https://openservice-test.vrr.de/static02')

Departure Monitor

The departure monitor requests the next departures for the given stop id starting at the given time. Only departures of services matching the given modes of transport are requested. Stop ids can be obtained using the station finder. The example below lists the next 40 regional train and S-Bahn departures out of Düsseldorf Hbf, also informing about delays:

simplifyEfa.departureMonitor(20018235, new Date(), [ModeOfTransport.REGIONAL_RAILWAY], 40)
  .then((departures) => {
    for (const departure of departures) {
      console.log(`${departure.servingLine.lineNumber} leaving for
                   ${departure.servingLine.directionTo} at ${departure.dateTime}`)

      // Check if we have real-time data and there is a delay.
      if (departure.realDateTime !== undefined &&
          departure.realDateTime != departure.dateTime) {
        console.log(` > Delayed! Actual time of departure is ${departure.realDateTime}`)
      }
    }
  })
  .catch(function (error) {
    // Request failed
  });

Modes of Transport

Filtering departures is possible with the values of the mode of transport enumeration:

| Enumeration Value | German Translation | Comments | |:-------------------|:-------------------|:-------------------| | RAILWAY | Züge | Combination ofREGIONAL_RAILWAY,NATIONAL_RAILWAY,INTERNATIONAL_RAILWAYand HIGH_SPEED_RAILWAY | | URBAN_RAILWAY | S-Bahnen | | | METRO | U-Bahnen | | | CITY_RAILWAY | Stadtbahnen | | | TRAM | Straßenbahnen | | | CITY_BUS | Stadtbusse | | | REGIONAL_BUS | Regionalbusse | | | EXPRESS_BUS | Expressbusse | | | CABLE_AND_COG_RAILWAY | Seil- und Zahnradbahnen | | | AST_ON_CALL_BUS | AST und Rufbusse | | | SUSPENSION_RAILWAY | Schwebebahnen | | | AIRPLANE | Flugzeuge | | | REGIONAL_RAILWAY | IRE, RE, RB | | | NATIONAL_RAILWAY | IR, D | | | INTERNATIONAL_RAILWAY | IC, EC | | | HIGH_SPEED_RAILWAY | ICE | | | RAIL_REPLACEMENT_SERVICE | Schienenersatzverkehr | | | SHUTTLE_RAILWAY | Shuttlezüge | | | CITIZENS_BUS | Bürgerbusse | |

Station Finder

The station finder allows requesting station information for a given query string. It can be used to find the stop ids required for requests to the departure monitor. The search algorithm isn't as good, while searching for 'Düsseldorf Hbf' returns the only one correct station, searching for 'Düsseldorf Derendorf' does return multiple stations but not the one we are searching for. An example usage is given below:

simplifyEfa.stationFinder('Düsseldorf Hbf')
  .then((stations) => {
    for (const station of stations) {
      console.log(`Found ${station.name} with id ${station.stopId}`)
    }
  })
  .catch(function (error) {
    // Request failed
 });

Status

For the moment, the wrapper has only been tested against the EFA endpoint of the VRR, which is also used by default when constructing a SimplifyEfa object. Also, only the station finder and departure monitor functionality have been implemented for now.

Links

  • Official EFA documentation by the Verkehrsverbund Rhein-Ruhr (VRR): Link
  • Documentation of the EFA JSON interface by Münsterhack: Link
  • Wikipedia article about EFA: Link