Gathering detailed insights and metrics for mime-db
Gathering detailed insights and metrics for mime-db
Gathering detailed insights and metrics for mime-db
Gathering detailed insights and metrics for mime-db
npm install mime-db
Module System
Unable to determine the module system for this package.
Min. Node Version
Typescript Support
Node Version
NPM Version
1,120 Stars
831 Commits
260 Forks
47 Watching
12 Branches
92 Contributors
Updated on 23 Nov 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-1.7%
13,507,331
Compared to previous day
Last week
4.6%
74,792,653
Compared to previous week
Last month
17.8%
296,018,922
Compared to previous month
Last year
10.2%
2,754,293,853
Compared to previous year
This is a large database of mime types and information about them. It consists of a single, public JSON file and does not include any logic, allowing it to remain as un-opinionated as possible with an API. It aggregates data from the following sources:
1npm install mime-db
If you intend to use this in a web browser, you can conveniently access the JSON file via jsDelivr, a popular CDN (Content Delivery Network). To ensure stability and compatibility, it is advisable to specify a release tag instead of using the 'master' branch. This is because the JSON file's format might change in future updates, and relying on a specific release tag will prevent potential issues arising from these changes.
https://cdn.jsdelivr.net/gh/jshttp/mime-db@master/db.json
1var db = require('mime-db') 2 3// grab data on .js files 4var data = db['application/javascript']
The JSON file is a map lookup for lowercased mime types. Each mime type has the following properties:
.source
- where the mime type is defined.
If not set, it's probably a custom media type.
apache
- Apache common media typesiana
- IANA-defined media typesnginx
- nginx media types.extensions[]
- known extensions associated with this mime type..compressible
- whether a file of this type can be gzipped..charset
- the default charset associated with this type, if any.If unknown, every property could be undefined
.
The primary way to contribute to this database is by updating the data in one of the upstream sources. The database is updated from the upstreams periodically and will pull in any changes.
The best way to get new media types included in this library is to register them with the IANA. The community registration procedure is outlined in RFC 6838 section 5. Types registered with the IANA are automatically pulled into this library.
If that is not possible / feasible, they can be added directly here as a "custom" type. To do this, it is required to have a primary source that definitively lists the media type. If an extension is going to be listed as associateed with this media type, the source must definitively link the media type and extension as well.
To edit the database, only make PRs against src/custom-types.json
or
src/custom-suffix.json
.
The src/custom-types.json
file is a JSON object with the MIME type as the
keys and the values being an object with the following keys:
compressible
- leave out if you don't know, otherwise true
/false
to
indicate whether the data represented by the type is typically compressible.extensions
- include an array of file extensions that are associated with
the type.notes
- human-readable notes about the type, typically what the type is.sources
- include an array of URLs of where the MIME type and the associated
extensions are sourced from. This needs to be a primary source;
links to type aggregating sites and Wikipedia are not acceptable.To update the build, run npm run build
.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
project has 18 contributing companies or organizations
Details
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
5 out of 9 merged PRs checked by a CI test -- score normalized to 5
Reason
2 commit(s) and 4 issue activity found in the last 90 days -- score normalized to 5
Reason
security policy file detected
Details
Reason
Found 8/29 approved changesets -- score normalized to 2
Reason
dependency not pinned by hash detected -- score normalized to 1
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
no update tool detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Score
Last Scanned on 2024-11-25T21:27:19Z
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More@types/mime-db
TypeScript definitions for mime-db
mime-type
the custom more powerful mime-type utility can work with mime-db.
@thi.ng/mime
650+ file extension to MIME type mappings, based on mime-db
@magic/mime-types
mime-db, in a key => value store where keys are extensions and values are mime/types