1.0.17 • Published 4 years ago

random-flight-generator v1.0.17

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

Installation

npm install --save random-flight-generator

Example Usage

JS

var flightGenerator = require('random-flight-generator');

var options = { minDistance: 5, maxDistance: 100 }
var flight = flightGenerator(options);

console.log(flight.departure);
console.log(flight.arrival);

flight.print(); // Logs all the flight information

TS

import flightGenerator from 'random-flight-generator';

const options = { minDistance: 5, maxDistance: 100 }
const flight = flightGenerator(options);

console.log(flight.departure);
console.log(flight.arrival);

flight.print(); // Logs all the flight information

Options

KeyTypeExample ValueDescription
minDistancenumber5The minimum distance (in nautical miles) that the generated flight must have
maxDistancenumber100The maximum distance (in nautical miles) that the generated flight must have
departurestring'KMIA'The ICAO code of the desired departure airport
arrivalstring'KMIA'The ICAO code of the desired arrival airport
includeCountriesstring 'US', 'BR'Restrict results to only these countries
excludeCountriesstring 'US', 'BR'Restrict results to all countries except these
majorAirportsOnlybooleantrue(Recommended) Restrict results to only major airports with IATA codes

API

https://us-central1-flight-generator.cloudfunctions.net/flightGenerator

Receives all options above as params. For includeCountries and excludeCountries, use a string instead of an array. E.g. 'US,BR,IT'

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago