Deprecated: This library was superseeded by @web-std/file. Please use that library instead.
Web API compatible File for nodejs.
import { File, Blob } from "web-file-polyfill"
const file = new File(["hello", new TextEncoder().encode("world")], "hello")
for await (const chunk of blob.stream()) {
console.log(chunk)
}
This library makes use of typescript using JSDOC annotations and also generates type difinitions along with typed definition maps. So you should be able to get all the type innference out of the box.
npm install web-file-polyfill