Last active
April 5, 2018 19:00
-
-
Save cmstead/4873522004fceae5d1d0f1be3a974d36 to your computer and use it in GitHub Desktop.
Removing Require and Import
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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