Skip to content

This is a fork of the airport-codes node module. The purpose of which was to update the stale airport data. All credit goes to https://github.com/L1fescape/airport-codes

Notifications You must be signed in to change notification settings

FDM-Tech/airport-codes-updated-2021

 
 

Repository files navigation

Airport Codes

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

Install

npm install airport-codes-updated-2021

Usage

The list of airport codes is wrapped in a Backbone Collection, so have access to all normal collection methods like findWhere, at, and sort.

var airports = require('airport-codes');

console.log(airports.findWhere({ iata: 'LAX' }).get('name'));
//=> Los Angeles Intl

console.log(airports.at(124).get('city'));;
//=> Sydney

console.log(airports.at(0).get('name'));
//=> Goroka
airports.comparator = 'city';
airports.sort();
console.log(airports.at(0).get('name'));
//=> 7 Novembre

If you'd like only the JSON list of airport codes, you can use either the Backbone Collection's toJSON method or import the json list directly:

require('airport-codes').toJSON();
require('airport-codes/airports.json');

About

This is a fork of the airport-codes node module. The purpose of which was to update the stale airport data. All credit goes to https://github.com/L1fescape/airport-codes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%