# airline-codes

> Airline codes (IATA) and information pulled from OpenFlights.org.

Latest version **1.1.7** (published 2026-10-31) · ISC license · 0 weekly downloads

## Install

```sh
npm install airline-codes
pnpm add airline-codes
yarn add airline-codes
bun add airline-codes
```

## Health

**Score 60/100 (C)** — status: active.

Positive: no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 1.1.7 |
| Published | 2026-10-31 |
| First published | 2016-05-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 1.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 52 |
| Author | Nissan Pow |
| Maintainers | npow |
| Keywords | airline, codes, iata, openflights |

## Links

- npm: https://www.npmjs.com/package/airline-codes
- Repository: https://github.com/npow/airline-codes
- Issues: https://github.com/npow/airline-codes/issues
- npm.io page: https://npm.io/package/airline-codes

## Dependencies (4)

- [csv](https://npm.io/package/csv.md) ^6.6.3
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [backbone](https://npm.io/package/backbone.md) ^1.1.2
- [JSONStream](https://npm.io/package/JSONStream.md) ^1.0.4

## Recent versions

- 1.1.7 (latest) — 2026-10-31
- 1.1.6 — 2026-09-08
- 1.1.5 — 2026-06-14
- 1.1.4 — 2026-06-14
- 1.1.3 — 2026-06-14
- 1.1.2 — 2026-03-11
- 1.1.1 — 2026-03-09
- 1.1.0 — 2026-03-05
- 1.0.3 — 2024-03-07
- 1.0.2 — 2016-05-24

## README

# Airline Codes

[![Docs](https://img.shields.io/badge/docs-mintlify-18a34a?style=flat-square)](https://mintlify.com/npow/airline-codes)

> Airline codes (IATA) and information pulled from OpenFlights.org

## Install

```
npm install airline-codes
```

## Usage

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

```javascript
var airlines = require('airline-codes');

console.log(airlines.findWhere({ iata: 'WS' }).get('name'));
//=> Westjet
```

If 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:

```javascript
require('airline-codes').toJSON();
require('airline-codes/airlines.json');
```

## Update the list of Airline Codes

Data is synced automatically every week from [jpatokal/openflights](https://github.com/jpatokal/openflights). To update manually:

```
$ wget https://raw.githubusercontent.com/jpatokal/openflights/master/data/airlines.dat
$ node normalize.js   # apply local corrections (country names, etc.)
$ node convert.js     # regenerate airlines.json from airlines.dat
```

### Adding corrections

Upstream data uses different conventions for some country names and contains occasional data quality issues. `normalize.js` maintains a `COUNTRY_CORRECTIONS` map that is applied automatically after every upstream fetch. To add a new correction, edit the map in `normalize.js`:

```javascript
var COUNTRY_CORRECTIONS = {
  'Macao': 'Macau',
  'Republic of Korea': 'South Korea',
  // add new entries here ...
};
```

After editing, re-run the pipeline above to apply the change.

For other field corrections, add an entry to `ID_CORRECTIONS`, keyed by the
existing airline ID. For missing airlines, add a row to `ADDITIONS` with a stable,
unique negative ID below `-10000` and a source comment. These IDs are local to
this package, not OpenFlights IDs. Normalization preserves historical records,
avoids duplicate additions on repeated runs, and uses the upstream ID once an
active airline with the same ICAO code and country appears upstream.

## Thanks

- [Andrew Kennedy](https://github.com/akenn/airport-codes)
- [Ram Nadella](https://github.com/ram-nadella/airport-codes)
- [Jani Patokallio](https://github.com/jpatokal/openflights/)

---
_Source: https://npm.io/package/airline-codes · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
