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

airport-router

v0.0.3

Published

## About package

Readme

NodeJs Backend test-task

About package

Someone could find useful to extend this package that could help to find shortest/fastest way to go from Airport A to Airport B. Algorythm in the file ./src/app/index.ts

Task description

The test task consists of two parts, the main part, and a bonus part. We suggest tackling the bonus part once the main objective of the service has been achieved.

The task is to build a JSON over HTTP API endpoint that takes as input two IATA/ICAO airport codes and provides as output a route between these two airports so that:

  1. The route consists of at most 4 legs/flights (that is, 3 stops/layovers, if going from A->B, a valid route could be A->1->2->3->B, or for example A->1->B etc.) and;
  2. The route is the shortest such route as measured in kilometers of geographical distance.

For the bonus part, extend your service so that it also allows changing airports during stops that are within 100km of each other. For example, if going from A->B, a valid route could be A->1->2=>3->4->B, where “2=>3” is a change of airports done via ground. Multiple ground hops are allowed, but they cannot be consecutive. These switches are not considered as part of the legs/layover/hop count, but their distance should be reflected in the final distance calculated for the route.

Notes:

  1. The weekdays and flight times are not important for the purposes of the test task - you are free to assume that all flights can depart any required time
  2. You are free to choose to use any open-source libraries
  3. You can ask additional questions

Service

In this repository, you will find an express service written in typescript. The repository assumes you have configured Yarn and Node.js (18+) on your system.

Your goal is to modify this service so that it fulfills the requirements of the test task.

The service is already configured with data from OpenFlights, which albeit outdated, will work fine for the purposes of this test task.

The service also includes a set of tests, which can be executed via yarn test, these represent two cases for the first part and one case for the second part of the task. Once you are confident that your solution works, these tests should pass. Notice that these tests also enforce a specific response format for your service.

Docker

The service is also setup to run in docker, you can use the docker-compose file to run either the service itself (exposes the same port 3000 as with yarn start/yarn start:dev) - docker-compose up -d service.

You can also run the tests via docker-compose up test.