Skip to content

Instantly share code, notes, and snippets.

@cmstead
Last active April 5, 2018 19:00
Show Gist options
  • Save cmstead/4873522004fceae5d1d0f1be3a974d36 to your computer and use it in GitHub Desktop.
Save cmstead/4873522004fceae5d1d0f1be3a974d36 to your computer and use it in GitHub Desktop.
Removing Require and Import
'use strict';
const logger = require('../loggerFactory').create();
const fs = require('fs');
function readAFile(filepath) {
try {
return fs.readFileSync(filePath, { encoding: 'utf8' });
} catch (e) {
logger.log(e.message);
return null;
}
}
module.exports = {
readAFile: readAFile
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment