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

@digitransit-store/digitransit-store-future-route

v2.0.8

Published

digitransit-store future-route module

Readme

@digitransit-store/digitransit-store-future-route

createUrl

Builds an itinerary summary URL for a future route entry.

Parameters

  • item Object A FutureRoute item, as produced by addFutureRoute.

  • pathOpts Object? Options for the generated path.

    • pathOpts.itinerarySummaryPrefix string? Path prefix to use instead of the default 'reitti'.

Examples

const route = {
  properties: {
    origin: { name: 'Pasila', localadmin: 'Helsinki', coordinates: { lat: 60.198828, lon: 24.933514 } },
    destination: { name: 'Ilmala', localadmin: 'Helsinki', coordinates: { lat: 60.208466, lon: 24.919756 } },
    arriveBy: true,
    time: 1600866900,
  },
};
createUrl(route);
//=> '/reitti/Pasila%2C%20Helsinki%3A%3A60.198828%2C24.933514/Ilmala%2C%20Helsinki%3A%3A60.208466%2C24.919756?time=1600866900&arriveBy=true'

Returns string The itinerary summary URL, or '' if the item is missing an origin, destination or time.

addFutureRoute

Adds a future route to a collection of future routes, replacing any existing entry for the same origin/destination pair and dropping entries whose time has already passed.

Parameters

  • item Object The route to add.

    • item.origin Object

      • item.origin.address string Comma-separated "name, localadmin" address.
      • item.origin.coordinates {lat: number, lon: number}
    • item.destination Object

      • item.destination.address string Comma-separated "name, localadmin" address.
      • item.destination.coordinates {lat: number, lon: number}
    • item.arriveBy boolean?

    • item.time (number | string) Unix timestamp (seconds, or a numeric string - e.g. as received from a URL query parameter) of the future trip.

  • collection Array<Object>? The existing collection of future routes.

Examples

const newRoute = {
  origin: { address: 'Pasila, Helsinki', coordinates: { lat: 60.198828, lon: 24.933514 } },
  destination: { address: 'Myyrmäki, Vantaa', coordinates: { lat: 60.261238, lon: 24.854782 } },
  arriveBy: false,
  time: 1600888888,
};
addFutureRoute(newRoute, existingFutureRoutes);

Returns Array<Object> The updated collection, sorted by time. If item.time is missing or cannot be parsed as a finite number, the collection is returned unchanged. If item.time is now or in the next five minutes, the item is not added - and any existing entry for the same origin/destination pair is removed - and the (possibly pruned) collection is returned instead.


This module is part of the Digitransit-ui project. It is maintained in the HSLdevcom/digitransit-ui repository, where you can create PRs and issues.

Installation

Install this module individually:

$ npm install @digitransit-store/digitransit-store-future-route