You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to #163 the .load() API was removed to avoid filesystem related dependencies (which makes good sense)!
mime.load -> deleted (Relic of when node-mime straight from apache's mime.types file, introduced dependencies on path and fs that have been problematic as this module has moved into new spaces (Electron, react-native, etc)
Consequently, both projects are stuck with an earlier node-mime module until there's a path forward: either a new module for doing the loading or an optional feature here (or something).
Regardless, it'd be great to have this back in some form!
I'm afraid load() won't be coming back. I removed it not just because of the dependency issues mentioned previously (which are still valid concerns), but also because switching to mime-db meant there was no longer an internal need to load custom type files, especially in Apache's proprietary format.
If you want to create a separate module to load Apache .types it should be pretty straight-forward. Just copy/paste the .load() implementation , and format it into a structure suitable for passing to v2's mime.define().
@BigBlueHat that works for me, if you want to be the all new maintainer of a apache mime.types loader package, it does look like it's relatively straightforward.
According to #163 the
.load()
API was removed to avoid filesystem related dependencies (which makes good sense)!However, that removal is causing some pain in https://github.com/jfhbrook/node-ecstatic and (relatedly) https://github.com/indexzero/http-server both of which have provided loading custom mime type databases from existing formats via this
.load()
feature.Consequently, both projects are stuck with an earlier
node-mime
module until there's a path forward: either a new module for doing the loading or an optional feature here (or something).Regardless, it'd be great to have this back in some form!
Thanks!
🎩
/cc @jfhbrook
The text was updated successfully, but these errors were encountered: