forked from lancard/korea-flight-database
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheuroscope.js
52 lines (45 loc) · 1.64 KB
/
euroscope.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const fs = require('fs');
module.exports = {
initialize() {
if (!fs.existsSync('euroscope')) {
fs.mkdirSync('euroscope');
}
},
createEuroscopeAircraftFile() {
let fileContent = [];
for (const aircraft in aircraftList) {
fileContent.push(
[
aircraft,
aircraftList[aircraft].aircraftType[0] + aircraftList[aircraft].wakeTurbulenceCategory[0] + aircraftList[aircraft].engineCount + aircraftList[aircraft].engineType[0],
aircraftList[aircraft].manufacturer,
aircraftList[aircraft].description
].join("\t"))
}
fs.writeFileSync('euroscope/ICAO_aircraft.txt', fileContent.join("\n"));
},
createEuroscopeAirlineFile() {
let fileContent = [];
for (const airline in airlineList) {
fileContent.push(
[
airline,
airlineList[airline],
airlineList[airline]
].join("\t"))
}
fs.writeFileSync('euroscope/ICAO_airline.txt', fileContent.join("\n"));
},
createEuroscopeAirportFile() {
let fileContent = [];
for (const airport in airportList) {
fileContent.push(
[
airportList[airport].icaoCode,
airportList[airport].description,
airportList[airport].country
].join("\t"))
}
fs.writeFileSync('euroscope/ICAO_airport.txt', fileContent.join("\n"));
}
};