Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
openflights-cached
Advanced tools
A module that fetches newest OpenFlights airport data upon install and exposes in simple API allowing to search by ICAO and IATA codes.
A module that fetches newest OpenFlights airport data upon install and exposes in simple API.
$ npm install -s openflights-cached
Remeber that the data is fetched upon installation so it's always fresh, but also needs a connection to the NPM repo.
The module API exposes a number of methods allowing different ways to access OpenFlights data. The recommended ones are with the two lookup methods:
const openflights = require("openflights-cached");
console.log(openflights.findIATA("PEK").name);
// -> Beijing Capital International Airport
console.log(openflights.findICAO("SBUA").country)
// -> Brazil
These methods use simple lookup methods without loading any large data sets.
openflights-cached
exports the following methods and properties:
findICAO(icao: string): OpenFlightsEntry
- find airport data for ICAO codefindIATA(iata: string): OpenFlightsEntry
- find airport data for IATA codeiata2icao: {[iata: string]: string}
- lazy loader for openflights-cached/iata2icao
icaos
- lazy loader for openflights-cached/icaos
array
- lazy loader for openflights-cached/array
icao
- lazy loader for openflights-cached/icao
iata
- lazy loader for openflights-cached/iata
openflights-cached/iata2icao
exposes a simple hash of IATA keys and ICAO values.
const openflights = require("openflights-cached/iata2icao");
// ^^^^^^^^^^^ - this here's an object
const myAirport = openflights.BCN; // -> LEBL
openflights-cached/icaos
exposes a simple array of all ICAO ids.
const openflights = require("openflights-cached/icaos");
// ^^^^^^^^^^^ - this here's an array
const myAirport = openflights.includes('KLAS') // has Las Vegas
const myAirport = openflights.includes('KLAK') // this is a typo
openflights-cached/array
exposes an array of all [OpenFlight entries](#Entry type) - the JSON is approx. 2.1 megs and will probably use approx. double the amount of memory.
const openflights = require("openflights-cached/array");
// ^^^^^^^^^^^ - this here's an array
const myAirport = openflights.find(({iata}) => iata === "WAW"); // -> Warsaw Chopin
openflights-cached/icao
exposes an object of all OpenFlight entries indexed by ICAO ids - the JSON is approx. 2.3 megs and will probably use approx. double the amount of memory.
const openflights = require("openflights-cached/icao");
// ^^^^^^^^^^^ - this here's an object with icao ids as keys
const myAirport = openflights["EHAM"] // -> Amsterdam Schiphol
openflights-cached/iata
exposes an object of all OpenFlight entries indexed by IATA ids - the JSON is approx. 1.7 megs and will probably use approx. double the amount of memory.
const openflights = require("openflights-cached/iata");
// ^^^^^^^^^^^ - this here's an object with iata ids as keys
const myAirport = openflights["JFK"] // -> New York, JFK
Each entry exposed by the module is type of OpenFlightsEntry is an object with the following keys:
The module code is licensed as MIT (see MIT license here), the module fetches data from OpenFlights, keep in mind you need to follow that license too.
FAQs
A module that fetches newest OpenFlights airport data upon install and exposes in simple API allowing to search by ICAO and IATA codes.
We found that openflights-cached demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.