import * as fs from "fs" ; import { log } from "./logger" ; param path param type returns { string } export function readFile ( path , type ) { log . info ( "Reading %s file from %s" , type , path ) ; return fs . readFileSync ( path , "utf-8" ) ; } param { string } envName param { string } valueName export function getRequiredENVVar ( envName ) { const envVal = process . env [ envName ] ; if ( envVal === undefined ) { log . error ( "Missing %s required environment variable" , envName ) ; return process . exit ( 1 ) ; } else { return envVal ; } }