lib/reader/file_reader.js
function readFile(path) {
  if (!path) {
    throw new Error('The passed file must not be nil to be read.');
  }
  if (!FileUtils.doesFileExist(path)) {
    throw new Error(`The passed file '${path}' must exist and must not be a directory to be read.`);
  }
  return fs.readFileSync(path, 'utf-8').toString();
}
function readFile(path) {
  if (!path) {
    throw new Error('The passed file must not be nil to be read.');
  }
  if (!FileUtils.doesFileExist(path)) {
    throw new Error(`The passed file '${path}' must exist and must not be a directory to be read.`);
  }
  return fs.readFileSync(path, 'utf-8').toString();
}
function readFile ( path ) { if ( ! path ) { throw new Error ( 'The passed file must not be nil to be read.' ) ; } if ( ! FileUtils . doesFileExist ( path ) ) { throw new Error ( ` ${ path } ` ) ; } return fs . readFileSync ( path , 'utf-8' ) . toString ( ) ; }
Reads a given file.
@param path the file's path.
@returns {string} the file's content.
Reads a given file .