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

fahrgastrechte-js

v1.0.0

Published

A nodejs library to modify the template of the fahrgastrechte form.

Readme

fahrgastrechte-js

A nodejs library to modify the template of the fahrgastrechte form (PDF).

Installation

yarn add fahrgastrechte-js

How to use?

import { modifyPdf } from 'fahrgastrechte-js'

const pdfBuffer = await modifyPdf(
    'fahrgastrechte.pdf', // You will need the fahrgastrechte.pdf template pdf from https://www.bahn.de/wmedia/view/mdb/media/intern/fahrgastrechteformular.pdf
    { } // Data parameters 'BahnFahrgastrechteData'
)
// you can save the pdfBuffer to a file for example

The data parameters must be this type:

type BahnFahrgastrechteData = {
    start_station: BahnStation, // string
    end_station: BahnStation, // string
    date: BahnDate, // { day: 12, month: 13, year: 22 }
    scheduled_departure: BahnTime, // { hour: 12, minute: 23 }
    scheduled_arrival: BahnTime, // { hour: 12, minute: 23 }
    arrival_date: BahnDate, // { day: 12, month: 13, year: 22 }
    arrival_train: BahnTrain, // { train_type: 'ICE', train_number: 879 }
    arrival_time: BahnTime, // arrival time of arrival_train
    first_delayed_train: BahnTrain, // { train_type: 'ICE', train_number: 879 }
    first_delayed_train_scheduled_departure: BahnTime, // { hour: 12, month: 21 }
    // the 4 options in the form
    missed_connecting_train?: BahnStation, // string
    last_switch?: BahnStation, // string
    trip_cancelled_station?: BahnStation, // string
    used_other_transport_station?: BahnStation, // string
    payment: { // { payment: {} } means voucher 
        bank_transfer?: {
            account_ower: FirstnameLastname, // { firstname: '', lastname: '' }
            iban: IBAN, // string
            bic: BIC, // string
        }
    },
    person: {
        greeting: Greeting, // 'Herr' or 'Frau'
        title?: string, // e.g. Dr. or Prof.
        company?: string,
        name: FirstnameLastname, // { train_type: 'ICE', train_number: 879 }
        address_addition?: string,
        telephone_number?: TelephoneNumber, // string
        street: string,
        street_number: number,
        state?: string, // default germany
        postcode: number,
        city: string
    },
    // you can pass the bahncard OR the time_card 
    bahncard?: { // Bahncard 100
        number: string,
        birthday: BahnDate // { day: 12, month: 3, year: 2022 }
    },
    time_card?: { // = Zeitkarte
        number: string
    },
    advertising_email?: string // if you want to get ads pass an email address
}