1.1.1 • Published 6 years ago

airport-data-api-wrapper v1.1.1

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

airport-data-api-wrapper

Usage

import AirportDataApiWrapper from 'airport-data-api-wrapper'
import fetch from 'node-fetch'
const aiportData = new AirportDataApiWrapper({fetch})
airportData.acThumb('n1180m').then(res => console.log(res))
airportData.airportInfo('kcrg').then(res => console.log(res))

API

new AirportDataApiWrapper([options])

Constructor Options

  • fetch If a fetch method isn't globally available as it would be in browser, pass node-fetch in here.
  • responseHandler You can override the method that handles the first Promise returned by the fetch. You might want to get back info from the headers such as rate limit info.
const responseHandler = (res) => res.body
const airportData = new AirportDataApiWrapper({fetch,responseHandler})

acThumb(registration[,options])

  • registration An aircraft registration if passed as a string. Options if passed as an object.
  • options Other options as an object. See Airport-Data.com API reference

airportInfo(icao[,options])

Browser Limitations

  • Requires window.fetch or fetch polyfill
  • Requires support for Promises
  • Airport-data.com currently only serves over HTTP. Unless they start serving over HTTPS, this library will only function in-browser over HTTP.
1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago