sindresorhus / file-type

Detect the file type of a file, stream, or data
MIT License
3.64k stars 345 forks source link

Support reading from browser streams in server-side export #617

Closed notramo closed 2 months ago

notramo commented 9 months ago

In SvelteKit, the event.request.body is a web-interoperable stream. However, when this package is imported in a SvelteKit project running in Bun, it tries to load the NodeJS stuff.

I recommend moving the NodeJS-related legacy stuff into a file-type/node package, as the majority is moving towards modern standards with runtimes like Bun and Deno which support WinterCG stuff, and SSR frameworks like SvelteKit also support it.