Gathering detailed insights and metrics for mrmime
Gathering detailed insights and metrics for mrmime
Gathering detailed insights and metrics for mrmime
Gathering detailed insights and metrics for mrmime
A tiny (2.8kB) and fast utility for getting a MIME type from an extension or filename
npm install mrmime
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (88.41%)
JavaScript (11.59%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
325 Stars
31 Commits
7 Forks
5 Watchers
1 Branches
4 Contributors
Updated on Jul 02, 2025
Latest Version
2.0.1
Package Id
mrmime@2.0.1
Unpacked Size
32.23 kB
Size
6.21 kB
File Count
6
NPM Version
10.9.0
Node Version
22.12.0
Published on
Feb 17, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Lightweight – 2.8kB gzip
Only includes standard mime types; all experimental and vendor-specific mimetypes removed.
Performant
All lookups are O(1) with minimal processing.
Comprehensive Dictionary
Generated from mime-db
, which aggregates the IANA, NGINX, and Apache datasets.
Customizable
Exposes the mimes
dictionary for easy additions or overrides.
Supports Native ESM and Deno
Ships with CommonJS and ESM support!
$ npm install --save mrmime
1import { lookup, mimes } from 'mrmime'; 2 3// Get a MIME type 4// --- 5lookup('txt'); //=> "text/plain" 6lookup('.txt'); //=> "text/plain" 7lookup('a.txt'); //=> "text/plain" 8 9// Unknown extension 10// --- 11lookup('.xyz'); //=> undefined 12 13// Add extension to dictionary 14// --- 15mimes['xyz'] = 'hello/world'; 16lookup('xyz'); //=> "hello/world"
Returns: string
or undefined
Type: string
The extension or filename to lookup.
Important:
- Any
input
value is cast to string, lowercased, and trimmed.- If a filename or filepath is provided, only the extension will be used.
Running on Node v16.8.0
Load times:
mrmime 0.963ms
mime/lite 3.281ms
mime 6.751ms
Benchmark :: plain ("ext")
mime x 598,849 ops/sec ±0.28% (94 runs sampled)
mime/lite x 536,643 ops/sec ±0.11% (97 runs sampled)
mrmime x 835,885 ops/sec ±0.20% (97 runs sampled)
Benchmark :: leading (".ext")
mime x 368,656 ops/sec ±0.19% (99 runs sampled)
mime/lite x 368,318 ops/sec ±0.13% (97 runs sampled)
mrmime x 533,643 ops/sec ±0.10% (96 runs sampled)
Benchmark :: filename ("file.ext")
mime x 326,907 ops/sec ±0.17% (95 runs sampled)
mime/lite x 327,479 ops/sec ±0.12% (98 runs sampled)
mrmime x 512,823 ops/sec ±0.12% (99 runs sampled)
Of course, a thank-you to mime
serving the community all these years & for being a all-encompassing MIME type library. I've only ever needed lookup/getType
functionality – and now ESM support – so mrmime
can only ever support 1/3 of what mime
offers, at best.
This would not be possible without the team behind mime-db
, who have painstakingly maintained an amazing database for 7+ years.
Artwork created by mintinol, which I found here.
Finally, thanks to Tim Branyen for donating the package name :)
MIT © Luke Edwards
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 3/30 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
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