{"id":17485,"library":"airport-data","title":"Airport Data","description":"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.","status":"abandoned","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/valeriangalliat/fetch-airport-data","tags":["javascript"],"install":[{"cmd":"npm install airport-data","lang":"bash","label":"npm"},{"cmd":"yarn add airport-data","lang":"bash","label":"yarn"},{"cmd":"pnpm add airport-data","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package is a CommonJS module that exports a JSON array directly. Native ES module import using `import airports from 'pkg'` will not work as expected in many environments, often resulting in `TypeError`.","wrong":"import airports from 'airport-data'","symbol":"airports","correct":"const airports = require('airport-data')"},{"note":"While not natively ESM, `import * as airports from 'airport-data'` can sometimes work in Node.js ESM contexts to import the CJS module as a namespace object, with the array accessible directly. Depending on bundler/Node.js version, direct JSON import might also be possible: `import airports from 'airport-data/airports.json'`.","wrong":"import airports from 'airport-data';","symbol":"airports (ESM workaround)","correct":"import * as airports from 'airport-data';"}],"quickstart":{"code":"const airports = require('airport-data');\n\nconsole.log(`Total airports in database: ${airports.length}`);\n\n// Find an airport by IATA code\nconst yulAirport = airports.find(airport => airport.iata === 'YUL');\nif (yulAirport) {\n  console.log(`\nFound YUL Airport:`);\n  console.log(`  Name: ${yulAirport.name}`);\n  console.log(`  City: ${yulAirport.city}, ${yulAirport.country}`);\n  console.log(`  Coordinates: ${yulAirport.latitude}, ${yulAirport.longitude}`);\n}\n\n// Filter airports in a specific country\nconst canadianAirports = airports.filter(airport => airport.country === 'Canada');\nconsole.log(`\nNumber of Canadian airports: ${canadianAirports.length}`);","lang":"javascript","description":"Demonstrates loading the static airport data and performing basic filtering and lookup operations using CommonJS `require`."},"warnings":[{"fix":"For current airport data, use actively maintained alternatives or fetch directly from up-to-date sources like the OpenFlights API or other contemporary data providers.","message":"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.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"In an ESM context, consider using `import * as airports from 'airport-data'` or directly importing the JSON file if your build system or Node.js version supports it (`import airports from 'airport-data/airports.json'`). Ensure your build tools are configured for CJS interoperability.","message":"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.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-23T00:00:00.000Z","next_check":"2026-07-22T00:00:00.000Z","problems":[{"fix":"Ensure the package is installed in your project: `npm install airport-data`.","cause":"The package `airport-data` is not installed or the import path is incorrect.","error":"Error: Cannot find module 'airport-data'"},{"fix":"Use `import * as airports from 'airport-data'` for namespace import in ESM, or stick to `const airports = require('airport-data')` in CommonJS environments.","cause":"Attempting to use a CommonJS module that exports an array directly as a default ES module import, which isn't directly compatible without specific handling or a namespace import.","error":"TypeError: (0 , airport_data_1.default) is not a function (when using `import airports from 'airport-data'` in an ESM context)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}