Package Exports
- airline-codes
- airline-codes/airlines.json
- airline-codes/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (airline-codes) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Airline Codes
Airline codes (IATA) and information pulled from OpenFlights.org
Install
npm install airline-codesUsage
The list of airline codes is wrapped in a Backbone Collection, so have access to all normal collection methods like findWhere, at, and sort.
var airlines = require('airline-codes');
console.log(airlines.findWhere({ iata: 'WS' }).get('name'));
//=> WestjetIf you'd like only the JSON list of airline codes, you can use either the Backbone Collection's toJSON method or import the json list directly:
require('airline-codes').toJSON();
require('airline-codes/airlines.json');Update the list of Airline Codes
Fetch Airline codes
$ wget https://raw.githubusercontent.com/jpatokal/openflights/master/data/airlines.datGenerate the list
Convert the list of airlines codes from csv format to JSON.
node convert.js