UNPKG

all-airports

Version:

Serves as an independent data scraping module, complete with ontology and full scraping ability for the airports of the world

22 lines (21 loc) 648 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var fs = require("graceful-fs"); var globalStore_1 = require("../constants/globalStore"); function loadFile(fileName, storeName, isCountry) { var fileData; // If file exists, great. Otherwise make a blank one for later. try { fileData = fs.readFileSync("dist/json/" + fileName + ".json"); } catch (err) { fileData = ''; } // If preexisting file data, use it. if (fileData) { var file = JSON.parse(fileData); globalStore_1.store[storeName] = file; } } exports.loadFile = loadFile; ;