{"_id":"mrmime","_rev":"3781210","name":"mrmime","description":"A tiny (2.8kB) and fast utility for getting a MIME type from an extension or filename","dist-tags":{"latest":"2.0.1"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"time":{"modified":"2025-05-16T07:34:37.000Z","created":"2014-07-22T20:33:12.655Z","2.0.1":"2025-02-17T18:17:05.137Z","2.0.0":"2023-12-20T15:24:42.745Z","1.0.1":"2022-06-08T16:08:30.797Z","1.0.0":"2021-10-12T06:58:37.395Z","0.1.2":"2014-07-22T20:36:34.929Z","0.1.1":"2014-07-22T20:35:16.843Z","0.1.0":"2014-07-22T20:33:12.655Z"},"users":{},"author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"repository":{"type":"git","url":"git+https://github.com/lukeed/mrmime.git"},"versions":{"2.0.1":{"name":"mrmime","version":"2.0.1","repository":{"type":"git","url":"git+https://github.com/lukeed/mrmime.git"},"description":"A tiny (2.8kB) and fast utility for getting a MIME type from an extension or filename","module":"index.mjs","types":"index.d.ts","main":"index.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"},"./package.json":"./package.json"},"engines":{"node":">=10"},"scripts":{"build":"tsm bin/index.ts","test":"uvu -r tsm test"},"keywords":["mime","extension","mimetype"],"devDependencies":{"tsm":"2.3.0","uvu":"0.5.2"},"_id":"mrmime@2.0.1","gitHead":"c95e4bf5ac71e7847c7e74d409e237a37c7b5053","bugs":{"url":"https://github.com/lukeed/mrmime/issues"},"homepage":"https://github.com/lukeed/mrmime#readme","_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"shasum":"bc3e87f7987853a54c9850eeb1f1078cd44adddc","size":6358,"noattachment":false,"key":"/mrmime/-/mrmime-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/mrmime/download/mrmime-2.0.1.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mrmime_2.0.1_1739816224943_0.6970574894840189"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-02-17T18:17:05.137Z","publish_time":1739816225137,"_source_registry_name":"default","_cnpm_publish_time":1739816225137},"2.0.0":{"name":"mrmime","version":"2.0.0","repository":{"type":"git","url":"git+https://github.com/lukeed/mrmime.git"},"description":"A tiny (2.8kB) and fast utility for getting a MIME type from an extension or filename","module":"index.mjs","types":"index.d.ts","main":"index.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"},"./package.json":"./package.json"},"engines":{"node":">=10"},"scripts":{"build":"tsm bin/index.ts","test":"uvu -r tsm test"},"keywords":["mime","extension","mimetype"],"devDependencies":{"tsm":"2.3.0","uvu":"0.5.2"},"_id":"mrmime@2.0.0","gitHead":"84088a80ca3dd86ebc920f181c1f2c8bfb878508","bugs":{"url":"https://github.com/lukeed/mrmime/issues"},"homepage":"https://github.com/lukeed/mrmime#readme","_nodeVersion":"20.8.1","_npmVersion":"10.1.0","dist":{"shasum":"151082a6e06e59a9a39b46b3e14d5cfe92b3abb4","size":6297,"noattachment":false,"key":"/mrmime/-/mrmime-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/mrmime/download/mrmime-2.0.0.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mrmime_2.0.0_1703085882536_0.3851164833884635"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-12-20T15:24:42.745Z","publish_time":1703085882745,"_source_registry_name":"default","_cnpm_publish_time":1703085882745},"1.0.1":{"name":"mrmime","version":"1.0.1","repository":{"type":"git","url":"git+https://github.com/lukeed/mrmime.git"},"description":"A tiny (2.8kB) and fast utility for getting a MIME type from an extension or filename","module":"index.mjs","types":"index.d.ts","main":"index.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"},"./package.json":"./package.json"},"engines":{"node":">=10"},"scripts":{"build":"node bin && bundt","test":"uvu -r esm test"},"keywords":["mime","extension","mimetype"],"devDependencies":{"bundt":"1.1.1","esm":"3.2.25","uvu":"0.5.2"},"gitHead":"8527fd70019ca8eb8055528b2ea6921851b2b6ad","bugs":{"url":"https://github.com/lukeed/mrmime/issues"},"homepage":"https://github.com/lukeed/mrmime#readme","_id":"mrmime@1.0.1","_nodeVersion":"18.3.0","_npmVersion":"8.11.0","dist":{"shasum":"5f90c825fad4bdd41dc914eff5d1a8cfdaf24f27","size":6003,"noattachment":false,"key":"/mrmime/-/mrmime-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/mrmime/download/mrmime-1.0.1.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mrmime_1.0.1_1654704510596_0.8181158026244222"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-06-08T16:10:47.182Z","publish_time":1654704510797,"_cnpm_publish_time":1654704510797},"1.0.0":{"name":"mrmime","version":"1.0.0","repository":{"type":"git","url":"git+https://github.com/lukeed/mrmime.git"},"description":"A tiny (2.8kB) and fast utility for getting a MIME type from an extension or filename","module":"index.mjs","types":"index.d.ts","main":"index.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"exports":{".":{"import":"./index.mjs","require":"./index.js"},"./package.json":"./package.json"},"engines":{"node":">=10"},"scripts":{"build":"node bin && bundt","test":"uvu -r esm test"},"keywords":["mime","extension","mimetype"],"devDependencies":{"bundt":"1.1.1","esm":"3.2.25","uvu":"0.5.2"},"gitHead":"915ea17ae43a10f66503650d56fc8e9da36e5dba","bugs":{"url":"https://github.com/lukeed/mrmime/issues"},"homepage":"https://github.com/lukeed/mrmime#readme","_id":"mrmime@1.0.0","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"shasum":"14d387f0585a5233d291baba339b063752a2398b","size":6000,"noattachment":false,"key":"/mrmime/-/mrmime-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/mrmime/download/mrmime-1.0.0.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mrmime_1.0.0_1634021917251_0.06800244257391475"},"_hasShrinkwrap":false,"publish_time":1634021917395,"_cnpm_publish_time":1634021917395},"0.1.2":{"name":"mrmime","version":"0.1.2","description":"A Node.js fixture mocking library that actually works.","main":"lib/index.js","scripts":{"test":"mocha test","instrument":"DEBUG=true node lib/instrument","record":"RECORD=true DEBUG=true node lib/instrument"},"author":{"name":"Tim Branyen","url":"@tbranyen"},"license":"MIT","dependencies":{"body-parser":"~1.5.0","express":"~4.6.1","js-yaml":"~3.1.0","promise":"~5.0.0","promisify-node":"~0.1.2","request":"~2.37.0"},"gitHead":"6406adea574400345d6caa8bdeb291e43d7fb661","_id":"mrmime@0.1.2","_shasum":"330445be92218ea613be9515d978102e37fc721f","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"tbranyen","email":"tim@tabdeveloper.com"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"dist":{"shasum":"330445be92218ea613be9515d978102e37fc721f","size":5497,"noattachment":false,"key":"/mrmime/-/mrmime-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/mrmime/download/mrmime-0.1.2.tgz"},"directories":{},"publish_time":1406061394929,"_cnpm_publish_time":1406061394929,"_hasShrinkwrap":false},"0.1.1":{"name":"mrmime","version":"0.1.1","description":"A Node.js fixture mocking library that actually works.","main":"lib/index.js","scripts":{"test":"mocha test","instrument":"DEBUG=true node lib/instrument","record":"RECORD=true DEBUG=true node lib/instrument"},"author":{"name":"Tim Branyen","url":"@tbranyen"},"license":"MIT","dependencies":{"body-parser":"~0.1.0","express":"~4.6.1","js-yaml":"~3.1.0","promise":"~5.0.0","promisify-node":"~0.1.2","request":"~2.37.0"},"gitHead":"afe83e867eeb119b946eda9a05e70b8ac88c284a","_id":"mrmime@0.1.1","_shasum":"415ea9b0bebd97d63a7c97100cb2535ec132fb11","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"tbranyen","email":"tim@tabdeveloper.com"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"dist":{"shasum":"415ea9b0bebd97d63a7c97100cb2535ec132fb11","size":5496,"noattachment":false,"key":"/mrmime/-/mrmime-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/mrmime/download/mrmime-0.1.1.tgz"},"directories":{},"publish_time":1406061316843,"_cnpm_publish_time":1406061316843,"_hasShrinkwrap":false},"0.1.0":{"name":"mrmime","version":"0.1.0","description":"A Node.js fixture mocking library that actually works.","main":"lib/index.js","scripts":{"test":"mocha test","instrument":"DEBUG=true node lib/instrument","record":"RECORD=true DEBUG=true node lib/instrument"},"author":{"name":"Tim Branyen","url":"@tbranyen"},"license":"MIT","dependencies":{"express":"^4.6.1","js-yaml":"^3.1.0","promise":"^5.0.0","promisify-node":"^0.1.2","request":"^2.37.0"},"gitHead":"e8f57b3c538f6f96061746bbfbf54f37d26e67dd","_id":"mrmime@0.1.0","_shasum":"93442f57437476e6f38adb323f9feefb4878ba91","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"tbranyen","email":"tim@tabdeveloper.com"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"dist":{"shasum":"93442f57437476e6f38adb323f9feefb4878ba91","size":5491,"noattachment":false,"key":"/mrmime/-/mrmime-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/mrmime/download/mrmime-0.1.0.tgz"},"directories":{},"publish_time":1406061192655,"_cnpm_publish_time":1406061192655,"_hasShrinkwrap":false}},"readme":"<div align=\"center\">\n  <img src=\"logo.png\" alt=\"mrmime\" width=\"320\" />\n</div>\n\n<div align=\"center\">\n  <a href=\"https://npmjs.org/package/mrmime\">\n    <img src=\"https://badgen.now.sh/npm/v/mrmime\" alt=\"version\" />\n  </a>\n  <a href=\"https://github.com/lukeed/mrmime/actions\">\n    <img src=\"https://github.com/lukeed/mrmime/workflows/CI/badge.svg\" alt=\"CI\" />\n  </a>\n  <a href=\"https://licenses.dev/npm/mrmime\">\n    <img src=\"https://licenses.dev/b/npm/mrmime\" alt=\"licenses\" />\n  </a>\n  <a href=\"https://npmjs.org/package/mrmime\">\n    <img src=\"https://badgen.now.sh/npm/dm/mrmime\" alt=\"downloads\" />\n  </a>\n  <a href=\"https://packagephobia.now.sh/result?p=mrmime\">\n    <img src=\"https://packagephobia.now.sh/badge?p=mrmime\" alt=\"install size\" />\n  </a>\n</div>\n\n<div align=\"center\">\n  A tiny (2.8kB) and fast utility for getting a MIME type from an extension or filename\n</div>\n\n\n## Features\n\n* Lightweight – 2.8kB gzip<br>\n  _Only includes standard mime types; all experimental and vendor-specific mimetypes removed._\n\n* [Performant](#benchmarks)<br>\n  _All lookups are O(1) with minimal processing._\n\n* Comprehensive Dictionary<br>\n  _Generated from [`mime-db`](https://github.com/jshttp/mime-db), which aggregates the IANA, NGINX, and Apache datasets._\n\n* Customizable<br>\n  _Exposes the `mimes` dictionary for easy additions or overrides._\n\n* Supports Native ESM and [Deno](https://deno.land/x/mrmime)<br>\n  _Ships with CommonJS and ESM support!_\n\n\n## Install\n\n```\n$ npm install --save mrmime\n```\n\n\n## Usage\n\n```js\nimport { lookup, mimes } from 'mrmime';\n\n// Get a MIME type\n// ---\nlookup('txt'); //=> \"text/plain\"\nlookup('.txt'); //=> \"text/plain\"\nlookup('a.txt'); //=> \"text/plain\"\n\n// Unknown extension\n// ---\nlookup('.xyz'); //=> undefined\n\n// Add extension to dictionary\n// ---\nmimes['xyz'] = 'hello/world';\nlookup('xyz'); //=> \"hello/world\"\n```\n\n\n## API\n\n### lookup(input)\nReturns: `string` or `undefined`\n\n#### input\nType: `string`\n\nThe extension or filename to lookup.\n\n> **Important:**\n>   * Any `input` value is cast to string, lowercased, and trimmed.\n>   * If a filename or filepath is provided, only the extension will be used.\n\n\n## Benchmarks\n\n> Running on Node v16.8.0\n\n```\nLoad times:\n  mrmime     0.963ms\n  mime/lite  3.281ms\n  mime       6.751ms\n\nBenchmark :: plain (\"ext\")\n  mime          x 598,849 ops/sec ±0.28% (94 runs sampled)\n  mime/lite     x 536,643 ops/sec ±0.11% (97 runs sampled)\n  mrmime        x 835,885 ops/sec ±0.20% (97 runs sampled)\n\nBenchmark :: leading (\".ext\")\n  mime          x 368,656 ops/sec ±0.19% (99 runs sampled)\n  mime/lite     x 368,318 ops/sec ±0.13% (97 runs sampled)\n  mrmime        x 533,643 ops/sec ±0.10% (96 runs sampled)\n\nBenchmark :: filename (\"file.ext\")\n  mime          x 326,907 ops/sec ±0.17% (95 runs sampled)\n  mime/lite     x 327,479 ops/sec ±0.12% (98 runs sampled)\n  mrmime        x 512,823 ops/sec ±0.12% (99 runs sampled)\n```\n\n\n## Credits\n\nOf course, a thank-you to [`mime`](https://github.com/broofa/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.\n\nThis would not be possible without the team behind [`mime-db`](https://github.com/jshttp/mime-db), who have painstakingly maintained an amazing database for 7+ years.\n\nArtwork created by [mintinol](https://www.deviantart.com/mintinol), which I found [here](https://www.deviantart.com/mintinol/art/Mr-Mime-373927920).\n\nFinally, thanks to [Tim Branyen](https://github.com/tbranyen) for donating the package name :)\n\n\n## License\n\nMIT © [Luke Edwards](https://lukeed.com)\n","_attachments":{},"homepage":"https://github.com/lukeed/mrmime#readme","bugs":{"url":"https://github.com/lukeed/mrmime/issues"},"license":"MIT"}