1
0
mirror of synced 2025-12-22 11:26:57 -05:00

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:
James M. Greene
2021-03-10 11:57:10 -06:00
committed by GitHub
parent c3b6ace1b6
commit 9e31597ee4
14 changed files with 51 additions and 41 deletions

6
lib/readfile-async.js Normal file
View 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)