# airport-codes

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

Latest version **1.0.2** (published 2015-07-17) · ISC license · 0 weekly downloads

## Install

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

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2015-07-17 |
| First published | 2015-07-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 24 |
| Author | Andrew Kennedy |
| Maintainers | l1fescape |
| Keywords | airport, codes, iata, openflights |

## Links

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

## Dependencies (4)

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

## Recent versions

- 1.0.2 (latest) — 2015-07-17
- 1.0.1 — 2015-07-14
- 1.0.0 — 2015-07-08

## README

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

## Install

```
npm install airport-codes
```

## 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`.

```javascript
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:

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

## Update the list of Airport Codes

### Fetch Airport codes

```
$ wget https://raw.githubusercontent.com/jpatokal/openflights/master/data/airports.dat
```

### Generate the list

Convert the list of airport codes from csv format to JSON.

```
node convert.js
```

## Thanks

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

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