* Opens a file as a Blob. * @param {string} filePath The file path * @param {object} [options] Options * @returns {Blob} The file content as a Blob
(filePath, options)
| 555 | * @returns {Blob} The file content as a Blob |
| 556 | */ |
| 557 | openAsBlob(filePath, options) { |
| 558 | const { Blob } = require('buffer'); |
| 559 | const providerPath = this.#toProviderPath(filePath); |
| 560 | const content = this[kProvider].readFileSync(providerPath); |
| 561 | const type = options?.type || ''; |
| 562 | return new Blob([content], { type }); |
| 563 | } |
| 564 | |
| 565 | // ==================== File Descriptor Operations ==================== |
| 566 |
no test coverage detected