Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

fetch-airport-data

valeriangalliat4Unlicense1.0.0

Fetch the OpenFlights Airports Database.

readme

Fetch airport data

Fetch the OpenFlights Airports Database.

Usage

const fetchAirportData = require('fetch-airport-data')

fetchAirportData()
  .then(airports => {
    // Your code here.
  })

airports is an array of airport objects, like:

{
  "id": 146,
  "name": "Montreal / Pierre Elliott Trudeau International Airport",
  "city": "Montreal",
  "country": "Canada",
  "iata": "YUL",
  "icao": "CYUL",
  "latitude": 45.4706001282,
  "longitude": -73.7407989502,
  "altitude": 118,
  "timezone": -5,
  "dst": "A",
  "tz": "America/Toronto",
  "type": "airport",
  "source": "OurAirports"
}

Static version

There's also an airport-data module containing a static version.

To update it, run npm run update, bump the version and publish.