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

Method prepare

lib/internal/fs/read/context.js:118–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

116 }
117
118 prepare() {
119 const buffer = getReadFileBuffer(this.options, this.size);
120
121 if (buffer !== undefined) {
122 this.buffer = buffer;
123 this.userBuffer = true;
124 this.bufferByteLengthName = getReadFileBufferByteLengthName(this.options);
125 return;
126 }
127
128 if (this.size === 0) {
129 this.buffers = [];
130 } else {
131 this.buffer = Buffer.allocUnsafeSlow(this.size);
132 }
133 }
134
135 read() {
136 let buffer;

Callers 15

readFileAfterStatFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 1

Tested by

no test coverage detected