jvilk / BrowserFS

BrowserFS is an in-browser filesystem that emulates the Node JS filesystem API and supports storing and retrieving files from various backends.
Other
3.06k stars 216 forks source link

No apparent way to determine mime type of a file #324

Closed TheAwesome98-Real closed 1 year ago

TheAwesome98-Real commented 2 years ago

When using node, to determine the type of a file, the file-type or mime packages might be used. But when using BrowserFS, these packages aren't available.

// even if you try (lol)
Uncaught TypeError: n is null
    require browserfs.ts:31
    <anonymous> debugger eval code:1

How can I find out the mime-type of a file using BrowserFS?

james-pre commented 1 year ago

@TheAwesome98-Real You may want to look into non-node libraries similar to file-type or mime.