1.0.4 • Published 4 years ago

iata-airports v1.0.4

Weekly downloads
12
License
ISC
Repository
-
Last release
4 years ago

IATA Active Airports

Airport codes (IATA) and information

Install

npm install iata-airports

Usage

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

const airports = require('iata-airports');

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('iata-airports').toJSON();
require('iata-airports/active_airports.json');
1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago