3.0.3 • Published 4 months ago

@nwpr/airport-codes v3.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

Airport Codes

Airport codes (IATA) and information pulled from OpenFlights.org

Fork which uses types in TypeScript.

INFO: Version 3.0.0 introduced breaking changes.

Install

npm install @nwpr/airport-codes

Usage

The list of airport codes is provided as typed array.

import { airports } from "@nwpr/airport-codes";

console.log(airports.find((airport) => airport.iata === "LAX")?.name);
// Los Angeles International Airport

console.log(airports[124].city);
// Sydney

console.log(airports[0].name);
// Goroka Airport

airports.sort((a, b) => a.city!.localeCompare(b.city!));
console.log(airports[0].name);
// Minsk Mazowiecki Military Air Base

If you'd like only the JSON list of airport codes, you can import the json list directly:

require("@nwpr/airport-codes/airports.json");

Update the list of Airport Codes

The list gets updated on installation. To manually update the list of airport codes afterwards:

node update.js

Thanks

3.0.3

4 months ago

3.0.2

4 months ago

3.0.1

4 months ago

3.0.0

4 months ago

2.0.3

7 months ago

2.0.2

7 months ago

2.0.1

7 months ago

2.0.0

7 months ago