(Medium) Why Small Modules Matter - Read The File
View original- current
This article is too short to summarise.
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
| const promisify = require("bluebird").promisify; | |
| const promiseToReadFile = promisify(require("fs").readFile); | |
| module.exports = function readFile(fileName) { | |
| return promiseToReadFile(fileName, "UTF-8"); | |
| }; |