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

Function buffer

test/parallel/test-fs-readfile-buffer-option.js:78–81  ·  view source on GitHub ↗
(fileSize)

Source from the content-addressed store, hash-verified

76 let size;
77 const data = fs.readFileSync(file, {
78 buffer(fileSize) {
79 size = fileSize;
80 return Buffer.alloc(fileSize + 8);
81 },
82 });
83 assert.strictEqual(size, content.length);
84 assert.deepStrictEqual(data, content);

Callers 2

validateReadFunction · 0.70

Calls 1

allocMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…