Comments (2)
You can do this, yes, but it's definitely beyond the scope of this module, which is just a database (part of the MIME database is what file extensions have been registered for which MIME types, which is how the file path stuff works). You can find modules on npm
that do this kind of lookup you are seeking through: https://www.npmjs.com/package/mmmagic is an example.
from mime-types.
Thank you, that answers my question perfectly.
from mime-types.
Related Issues (20)
- Is it possible to get is image HOT 2
- Can I contribute the features from my fork? (TypeScript, Browser support, uses "exports") HOT 2
- Way to override `mime-db` HOT 4
- application/javascript should be replaced with text/javascript HOT 6
- CRA to Vite migration, process is not defined error in 'mime-types' package.
- Wrong Mime Type for .wav file
- Drop outdated node platforms from CI test matrix HOT 3
- Use `mime-score` to resolve extension conflicts.
- Broken tests for Node@8 and Node@9
- [Resolve Method] extname is not function, at lookup function (vite) HOT 1
- lookup("map") returns "application/json" instead of false HOT 4
- Great library, but why "hide" information that is part of mime-db?
- New Version ETA HOT 12
- Remove "path" dependency from library HOT 11
- Change API to return null or undefined and not false HOT 3
- `image/svg+xml` charset HOT 1
- png with extension changed to jpg shows wrong mime type HOT 1
- Module not found: Error: Can't resolve 'path' in app/node_modules/mime-types HOT 4
- New release HOT 3
- ESM/browser support HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mime-types.