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

Method asyncReadFile

deps/v8/tools/js/web-api-helper.mjs:139–151  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

137 }
138
139 async asyncReadFile(file) {
140 this.updateProgressBar();
141 const decoder = globalThis.TextDecoderStream;
142 if (decoder) {
143 await this._streamFile(file, decoder);
144 } else {
145 await this._readFullFile(file);
146 }
147 this._updateLabel(`Finished loading '${file.name}'.`);
148 this.dispatchEvent(
149 new CustomEvent('fileuploadend', {bubbles: true, composed: true}));
150 this.root.className = 'done';
151 }
152
153 async _readFullFile(file) {
154 const text = await file.text();

Callers 1

readFileMethod · 0.95

Calls 5

updateProgressBarMethod · 0.95
_streamFileMethod · 0.95
_readFullFileMethod · 0.95
_updateLabelMethod · 0.95
dispatchEventMethod · 0.80

Tested by

no test coverage detected