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

Method readFile

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

Source from the content-addressed store, hash-verified

117 }
118
119 readFile(file) {
120 this.dispatchEvent(new CustomEvent('fileuploadstart', {
121 bubbles: true,
122 composed: true,
123 detail: {
124 progressCallback: this.setProgress.bind(this),
125 totalSize: file.size,
126 }
127 }));
128 if (!file) {
129 this.error = 'Failed to load file.';
130 return;
131 }
132 this.fileReader.blur();
133 this.setProgress(0);
134 this.root.className = 'loading';
135 // Delay the loading a bit to allow for CSS animations to happen.
136 window.requestAnimationFrame(() => this.asyncReadFile(file));
137 }
138
139 async asyncReadFile(file) {
140 this.updateProgressBar();

Callers 1

handleChangeMethod · 0.95

Calls 4

setProgressMethod · 0.95
asyncReadFileMethod · 0.95
dispatchEventMethod · 0.80
bindMethod · 0.45

Tested by

no test coverage detected