import * as fs from 'fs' import * as cmdargs from 'command-line-args' const OPTION_DEFINITIONS = [ { name: 'verbose', alias: 'v', type: Boolean }, { name: 'config', alias: 'c', type: String, defaultValue: '~/geofences.conf' } ]; export let dict : any export function readConfig() { let options = cmdargs(OPTION_DEFINITIONS) dict = JSON.parse(fs.readFileSync(options.config, "utf8")) } readConfig()