MCPcopy Index your code
hub / github.com/nodejs/node / readFile

Function readFile

test/parallel/test-fs-readfile-buffer-option.js:18–25  ·  view source on GitHub ↗
(path, options)

Source from the content-addressed store, hash-verified

16fs.writeFileSync(file, content);
17
18function readFile(path, options) {
19 return new Promise((resolve, reject) => {
20 fs.readFile(path, options, (err, data) => {
21 if (err) reject(err);
22 else resolve(data);
23 });
24 });
25}
26
27async function withFstatSizeZero(fn) {
28 const originalFstat = fsBinding.fstat;

Calls 3

rejectFunction · 0.50
resolveFunction · 0.50
readFileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…