Airline
Module to generate airline and airport related data.Overview
Several methods in this module return objects rather than strings. For example, you can use {{$airline.airportIataCode}}
to pick out the specific property you need.For a random airport, use {{$airline.airportName}}
and {{$airline.airportIataCode}}
.For a random airline, use {{$airline.airlineName}}
and {{$airline.airlineIataCode}}
.For a dummy booking, a passenger will generally book a flight on a specific {{$airline.flightNumber}}
, {{$airline.airplaneName}},
be allocated a {{$airline.seat}}
and {{$airline.recordLocator}}
.To generate sample passenger data, you can use the methods of the person module.
aircraftType#
Returns a random aircraft type.Returns: 'narrowbody' | 'regional' | 'widebody'
airline#
The original faker.airline.airline()
method has been refined into two more precise variables:{{$airline.airlineName}}
: Generates an airline name.
{{$airline.airlineIataCode}}
: Generates an airline IATA code.
Generates a random airline.
airplane#
The original faker.airline.airplane()
method has been refined into two more precise variables:{{$airline.airplaneName}}
: Generates an airplane name.
{{$airline.airplaneIataTypeCode}}
: Generates an airplane IATA code.
Generates a random airplane.
airport#
The original faker.airline.airport()
method has been refined into two more precise variables:{{$airline.airportName}}
: Generates an airport name.
{{$airline.airportIataCode}}
: Generates an airport IATA code.
Generates a random airport.
flightNumber#
Returns a random flight number. Flight numbers are always 1 to 4 digits long. Sometimes they are used without leading zeros (e.g.: American Airlines flight 425
) and sometimes with leading zeros, often with the airline code prepended (e.g.: AA0425
).To generate a flight number prepended with an airline code, combine this function with the airline()
function and use template literals:Name | Type | Default | Description |
---|
addLeadingZeros | boolean | false | Whether to pad the flight number up to 4 digits with leading zeros. |
length | number | { min: number; max: number; } | { min: 1, max: 4 } |
recordLocator#
Generates a random record locator. Record locators are used by airlines to identify reservations. They're also known as booking reference numbers, locator codes, confirmation codes, or reservation codes.Name | Type | Default | Description |
---|
allowNumerics | boolean | false | Whether to allow numeric characters. |
allowVisuallySimilarCharacters | boolean | false | Whether to allow visually similar characters such as '1' and 'I'. |
seat#
Name | Type | Default | Description |
---|
aircraftType | 'narrowbody' | 'regional' | 'widebody' | narrowbody | The aircraft type. Can be one of narrowbody , regional , widebody . |
Modified atΒ 2024-09-02 09:26:53