Use promisified fs.readFile instead of fs.promises.readFile (#18204)
* Create a readFileAsync wrapper module * Use the readFileAsync wrapper module instead of fs.promises.readFile * Fix require path in test
This commit is contained in:
6
lib/readfile-async.js
Normal file
6
lib/readfile-async.js
Normal file
@@ -0,0 +1,6 @@
|
||||
const fs = require('fs')
|
||||
const util = require('util')
|
||||
|
||||
// This is faster than using `fs.promises.readFile` for the time being
|
||||
// See: https://github.com/nodejs/node/issues/37583
|
||||
module.exports = util.promisify(fs.readFile)
|
||||
Reference in New Issue
Block a user