import * as fs from 'fs' ; export const BOM_CHAR_CODE = 65279 ; param path export function readFileSync ( path ) { let data = fs . readFileSync ( path ) . toString ( ) ; return removeBOM ( data ) ; } export function removeBOM ( data ) { if ( data . length > 0 && data . charCodeAt ( 0 ) === BOM_CHAR_CODE ) { data = data . substring ( 1 ) ; } return data ; }