Socket
Book a DemoInstallSign in
Socket

airport-data-api-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

airport-data-api-wrapper

A wrapper for the Airport-data.com API. Works in Browser or Node.

1.1.1
latest
Source
npmnpm
Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

airport-data-api-wrapper

  • An Airport-data.com API wrapper for Node or Browser.
  • Be familiar with Airport-data.com's API.
  • Use it in the browser globally on window, with require, or with AMD.
  • See browser limitations if using in the browser.

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.

FAQs

Package last updated on 13 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.