{"id":31754746,"url":"https://github.com/lukeed/mrmime","last_synced_at":"2025-10-09T18:23:26.329Z","repository":{"id":38238697,"uuid":"416217010","full_name":"lukeed/mrmime","owner":"lukeed","description":"A tiny (2.8kB) and fast utility for getting a MIME type from an extension or filename","archived":false,"fork":false,"pushed_at":"2025-02-17T18:17:03.000Z","size":122,"stargazers_count":328,"open_issues_count":3,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-10-06T03:05:30.083Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lukeed.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"lukeed"}},"created_at":"2021-10-12T06:47:41.000Z","updated_at":"2025-10-05T03:02:12.000Z","dependencies_parsed_at":"2024-06-18T12:41:16.910Z","dependency_job_id":"e7e6bbc4-61e4-4ab5-9fb5-ef79e726202d","html_url":"https://github.com/lukeed/mrmime","commit_stats":{"total_commits":28,"total_committers":3,"mean_commits":9.333333333333334,"dds":0.0714285714285714,"last_synced_commit":"e0cb79074739320d1a36dce98b11d641bbf2f20c"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/lukeed/mrmime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fmrmime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fmrmime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fmrmime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fmrmime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukeed","download_url":"https://codeload.github.com/lukeed/mrmime/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeed%2Fmrmime/sbom","scorecard":{"id":604498,"data":{"date":"2025-08-11","repo":{"name":"github.com/lukeed/mrmime","commit":"c95e4bf5ac71e7847c7e74d409e237a37c7b5053"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":1,"reason":"Found 3/30 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/lukeed/mrmime/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/lukeed/mrmime/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/lukeed/mrmime/ci.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license:0","Info: FSF or OSI recognized license: MIT License: license:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T01:15:55.070Z","repository_id":38238697,"created_at":"2025-08-21T01:15:55.071Z","updated_at":"2025-08-21T01:15:55.071Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000661,"owners_count":26082817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-09T18:23:09.229Z","updated_at":"2025-10-09T18:23:26.321Z","avatar_url":"https://github.com/lukeed.png","language":"TypeScript","funding_links":["https://github.com/sponsors/lukeed"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"logo.png\" alt=\"mrmime\" width=\"320\" /\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://npmjs.org/package/mrmime\"\u003e\n    \u003cimg src=\"https://badgen.now.sh/npm/v/mrmime\" alt=\"version\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/lukeed/mrmime/actions\"\u003e\n    \u003cimg src=\"https://github.com/lukeed/mrmime/workflows/CI/badge.svg\" alt=\"CI\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://licenses.dev/npm/mrmime\"\u003e\n    \u003cimg src=\"https://licenses.dev/b/npm/mrmime\" alt=\"licenses\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://npmjs.org/package/mrmime\"\u003e\n    \u003cimg src=\"https://badgen.now.sh/npm/dm/mrmime\" alt=\"downloads\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://packagephobia.now.sh/result?p=mrmime\"\u003e\n    \u003cimg src=\"https://packagephobia.now.sh/badge?p=mrmime\" alt=\"install size\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  A tiny (2.8kB) and fast utility for getting a MIME type from an extension or filename\n\u003c/div\u003e\n\n\n## Features\n\n* Lightweight – 2.8kB gzip\u003cbr\u003e\n  _Only includes standard mime types; all experimental and vendor-specific mimetypes removed._\n\n* [Performant](#benchmarks)\u003cbr\u003e\n  _All lookups are O(1) with minimal processing._\n\n* Comprehensive Dictionary\u003cbr\u003e\n  _Generated from [`mime-db`](https://github.com/jshttp/mime-db), which aggregates the IANA, NGINX, and Apache datasets._\n\n* Customizable\u003cbr\u003e\n  _Exposes the `mimes` dictionary for easy additions or overrides._\n\n* Supports Native ESM and [Deno](https://deno.land/x/mrmime)\u003cbr\u003e\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'); //=\u003e \"text/plain\"\nlookup('.txt'); //=\u003e \"text/plain\"\nlookup('a.txt'); //=\u003e \"text/plain\"\n\n// Unknown extension\n// ---\nlookup('.xyz'); //=\u003e undefined\n\n// Add extension to dictionary\n// ---\nmimes['xyz'] = 'hello/world';\nlookup('xyz'); //=\u003e \"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\u003e **Important:**\n\u003e   * Any `input` value is cast to string, lowercased, and trimmed.\n\u003e   * If a filename or filepath is provided, only the extension will be used.\n\n\n## Benchmarks\n\n\u003e 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 \u0026 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeed%2Fmrmime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukeed%2Fmrmime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeed%2Fmrmime/lists"}