Gistlib Logo

gistlib

blob to file in typescript

index.ts
function blobToFile(blob: Blob, fileName: string): File {
    const file = new File([blob], fileName, { type: blob.type });
    return file;
}
143 chars
5 lines

similar typescript code snippets

read a json file in typescript
find the root directory of a file in typescript
how to use the lstat function from the fs-extra library in typescript
write to a json file in typescript
send a post request with file nodejs in typescript
download video in typescript
check if file is an image in typescript
how to use the rename function from the fs-extra library in typescript
find the last modified date of a file in typescript
send a post request with file in typescript

related categories

typescript
blob
file

gistlibby LogSnag