Socket
Socket
Sign inDemoInstall

airports-nodejs

Package Overview
Dependencies
1
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    airports-nodejs

A comprehensive library providing easy retrieval of airport data based on IATA, ICAO, city codes, country codes, and continents.


Version published
Weekly downloads
3
decreased by-62.5%
Maintainers
1
Install size
9.40 MB
Created
Weekly downloads
 

Readme

Source

airports-nodejs

A comprehensive library providing easy retrieval of airport data based on IATA, ICAO, city codes, country codes, and continents. Ideal for developers building applications related to aviation, travel, and geography.

Features

  • Retrieve airport data using IATA code.
  • Retrieve airport data using ICAO code.
  • Fetch data using city codes.
  • Fetch data using country codes.
  • Retrieve data based on continents.
  • Built-in error handling for invalid input formats.
  • Efficiently packaged with minimized and gzipped data.
  • Comprehensive Data Access: Retrieve airport data using IATA code, ICAO code, city codes, country codes, and continents.
  • Unique Link Integration: The first library to provide direct links to FlightRadar24, Radarbox, and FlightAware for each airport, giving users immediate access to live flight tracking and airport data.

Installation

You can install airports-nodejs using npm:

npm install airports-nodejs

For detailed instructions on how to use this library in different environments, please refer to the following links:

Usage

Here's how you can use the library:

const airportData = require('airports-nodejs');

// Retrieve airport data using IATA code
const airportByIATA = airportData.getAirportByIata("AAA");
console.log(airportByIATA);

// Retrieve airport data using ICAO code
const airportByICAO = airportData.getAirportByIcao("NTGA");
console.log(airportByICAO);

// Fetch data using city codes
const airportByCityCode = airportData.getAirportByCityCode("NYC");
console.log(airportByCityCode);

// Fetch data using country codes
const airportByCountryCode = airportData.getAirportByCountryCode("US");
console.log(airportByCountryCode);

// Retrieve data based on continents
const airportByContinent = airportData.getAirportByContinent("AS");
console.log(airportByContinent);

Example Data Fields

For Chennai International Airport:

Field NameData
IATAMAA
ICAOVOMM
Time ZoneAsia/Kolkata
City CodeMAA
Country CodeIN
NameChennai International Airport
Latitude12.99
Longitude80.1693
Altitude (in feet)52
StateTamil Nadu
CityPallavaram
CountyKancheepuram
State CodeTamil Nadu
Airport Typelarge_airport
ContinentAS
State AbbreviationIN-TN
InternationalTRUE
Wikipedia LinkWikipedia
Official WebsiteChennai Airport
Location ID12513629
Phone Number044-2340551
Runway Length (in meters)10050
Flightradar24Flightradar24
RadarboxRadarbox
Flightaware LinkFlightaware

Singapore Changi Airport:

Field NameData
IATASIN
ICAOWSSS
Time ZoneAsia/Singapore
City CodeSIN
Country CodeSG
NameSingapore Changi Airport
Latitude1.35019
Longitude103.994
Altitude (in feet)22
StateSingapore
CitySingapore
CountySingapore
State CodeSouth East
Airport Typelarge_airport
ContinentAS
State AbbreviationSG-04
InternationalTRUE
Wikipedia LinkWikipedia
Official WebsiteChangi Airport
Location ID12517525
Phone Number(65) 6542 1122
Runway Length (in meters)13200
Flightradar24Flightradar24
RadarboxRadarbox
FlightawareFlightaware

Running the Project Locally

  1. Clone the repository:
git clone https://github.com/aashishvanand/airports-nodejs.git
  1. Change into the cloned directory:
cd airports-nodejs
  1. Install the necessary dependencies:
npm install
  1. To bundle the source code using Webpack:
npm run build
  1. To run tests:
npm test

Troubleshooting

  1. Issue: "Module not found: Error: Can't resolve 'babel-loader'". Solution: Ensure that you have installed all the necessary dependencies. If the issue persists, reinstall the library.

  2. Issue: "Error: Automatic publicPath is not supported in this browser". Solution: Ensure that you're using the library in a supported environment (Node.js or a modern browser).

If you encounter other issues, consider raising an issue on the GitHub repository.

License

This project is licensed under the Creative Commons Attribution 4.0 International (CC BY 4.0) - see the LICENSE file for details.

Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

Keywords

FAQs

Last updated on 07 Oct 2023

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc