CodyCC
Denoβ€’2y agoβ€’
19 replies
CodyC

How to open a file as blob?

Docs for Blob (https://deno.land/api@v1.42.0?s=Blob) say that File implements Blob. But the docs for Deno.File (https://deno.land/api@v1.42.0?s=Deno.File) say that it's deprecated and you should use FsFile instead. But FsFile (https://deno.land/api@v1.42.0?s=Deno.FsFile) doesn't implement Blob.

I could probably write my own wrapper that will make FsFile conform to Blob, but that feels like something that might already be in std somewhere?

(update: the important part here is that I want to wrap a file-like object, not read the entire file's contents into memory, since I'm working with potentially large files.)
Was this page helpful?