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

Function createBlobFromFilePath

lib/internal/blob.js:404–413  ·  view source on GitHub ↗
(path, options)

Source from the content-addressed store, hash-verified

402// TODO(@jasnell): Now that the File class exists, we might consider having
403// this return a `File` instead of a `Blob`.
404function createBlobFromFilePath(path, options) {
405 const maybeBlob = _createBlobFromFilePath(path);
406 if (maybeBlob === undefined) {
407 return lazyDOMException('The blob could not be read', 'NotReadableError');
408 }
409 const { 0: blob, 1: length } = maybeBlob;
410 const res = createBlob(blob, length, options?.type);
411 res[kNotCloneable] = true;
412 return res;
413}
414
415function arrayBuffer(blob) {
416 const { promise, resolve, reject } = PromiseWithResolvers();

Callers 1

openAsBlobFunction · 0.85

Calls 2

lazyDOMExceptionFunction · 0.85
createBlobFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…