Airport Data
raw JSON →The `airport-data` package provides a static JSON snapshot of airport information derived from the OpenFlights Airports Database. It offers a structured array of airport objects, each containing details such as ID, name, city, country, IATA and ICAO codes, geographical coordinates, altitude, timezone, and type. The current stable and only major version is 1.0.1, published over 8 years ago (as of 2026). This package serves as a direct, unmaintained dump of data from its time of publication, with no ongoing updates or release cadence. Its key differentiator is its simplicity as a pre-packaged JSON array, suitable for applications requiring historical or non-real-time airport data, but critically, it does not reflect any changes or additions to the global airport landscape since its last release.
Common errors
error Error: Cannot find module 'airport-data' ↓
npm install airport-data. error TypeError: (0 , airport_data_1.default) is not a function (when using `import airports from 'airport-data'` in an ESM context) ↓
import * as airports from 'airport-data' for namespace import in ESM, or stick to const airports = require('airport-data') in CommonJS environments. Warnings
gotcha The data provided by `airport-data@1.0.1` is a static snapshot published over 8 years ago (as of 2026). It is critically outdated and does not reflect new airports, closed airports, changed IATA/ICAO codes, or updated geographic/timezone information. ↓
gotcha This package is a CommonJS module (`module.exports = require('./airports.json')`) and does not provide a native ES module entry point. This can lead to issues or require specific configurations when used in modern ESM-only environments without transpilation. ↓
Install
npm install airport-data yarn add airport-data pnpm add airport-data Imports
- airports wrong
import airports from 'airport-data'correctconst airports = require('airport-data') - airports (ESM workaround) wrong
import airports from 'airport-data';correctimport * as airports from 'airport-data';
Quickstart
const airports = require('airport-data');
console.log(`Total airports in database: ${airports.length}`);
// Find an airport by IATA code
const yulAirport = airports.find(airport => airport.iata === 'YUL');
if (yulAirport) {
console.log(`
Found YUL Airport:`);
console.log(` Name: ${yulAirport.name}`);
console.log(` City: ${yulAirport.city}, ${yulAirport.country}`);
console.log(` Coordinates: ${yulAirport.latitude}, ${yulAirport.longitude}`);
}
// Filter airports in a specific country
const canadianAirports = airports.filter(airport => airport.country === 'Canada');
console.log(`
Number of Canadian airports: ${canadianAirports.length}`);