{"id":16542517,"url":"https://github.com/tada5hi/mime-explorer","last_synced_at":"2025-03-21T10:31:15.002Z","repository":{"id":65231733,"uuid":"588162241","full_name":"tada5hi/mime-explorer","owner":"tada5hi","description":"A versatile library that simplifies MIME type management, providing a user-friendly interface to effortlessly retrieve MIME types based on file paths/extensions, gather comprehensive meta information, and obtain standard file extensions for a given MIME type.","archived":false,"fork":false,"pushed_at":"2024-02-28T01:32:00.000Z","size":1190,"stargazers_count":5,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-03-18T00:03:04.515Z","etag":null,"topics":["content-type","content-types","mime","mime-type","mime-types"],"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/tada5hi.png","metadata":{"files":{"readme":"README.MD","changelog":"CHANGELOG.md","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":["tada5hi"]}},"created_at":"2023-01-12T13:28:17.000Z","updated_at":"2024-03-12T14:42:15.000Z","dependencies_parsed_at":"2023-02-17T19:30:39.611Z","dependency_job_id":"ce1b1c68-f2ec-4d21-b2d2-fb287be44faa","html_url":"https://github.com/tada5hi/mime-explorer","commit_stats":null,"previous_names":["tada5hi/mime-es"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tada5hi%2Fmime-explorer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tada5hi%2Fmime-explorer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tada5hi%2Fmime-explorer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tada5hi%2Fmime-explorer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tada5hi","download_url":"https://codeload.github.com/tada5hi/mime-explorer/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244777843,"owners_count":20508795,"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","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":["content-type","content-types","mime","mime-type","mime-types"],"created_at":"2024-10-11T18:57:47.391Z","updated_at":"2025-03-21T10:31:14.690Z","avatar_url":"https://github.com/tada5hi.png","language":"TypeScript","funding_links":["https://github.com/sponsors/tada5hi"],"categories":[],"sub_categories":[],"readme":"# mime-explorer ☂\n\n[![npm version](https://badge.fury.io/js/mime-explorer.svg)](https://badge.fury.io/js/mime-explorer)\n[![main](https://github.com/tada5hi/mime-explorer/actions/workflows/main.yml/badge.svg)](https://github.com/tada5hi/mime-explorer/actions/workflows/main.yml)\n[![codecov](https://codecov.io/gh/tada5hi/mime-explorer/branch/master/graph/badge.svg?token=80LA00PIGM)](https://codecov.io/gh/tada5hi/mime-explorer)\n[![Known Vulnerabilities](https://snyk.io/test/github/Tada5hi/mime-explorer/badge.svg?targetFile=package.json)](https://snyk.io/test/github/Tada5hi/mime-explorer?targetFile=package.json)\n[![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)\n\nA versatile library that simplifies MIME type management,\nproviding a user-friendly interface to effortlessly retrieve MIME types\nbased on file paths/extensions, gather comprehensive meta information,\nand obtain standard file extensions for a given MIME type.\n\nIt is well-suited for a variety of tasks,\nincluding seamless interaction with HTTP headers and general operations involving files.\n\n**Table of Contents**\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [License](#license)\n\n## Installation\n\n```bash\nnpm install mime-explorer --save\n```\n\n## Usage\n\nTo get the mime type for a given path or extension:\n\n```typescript\nimport { getType } from 'mime-explorer';\n\ngetType('txt');\n// =\u003e 'text/plain'\n\ngetType('json');\n// =\u003e 'application/json'\n```\n\nTo get the file extension for a given mime type:\n\n```typescript\nimport { getExtension } from 'mime-explorer';\n\ngetExtension('text/plain');\n// =\u003e 'txt'\n\ngetExtension('application/json');\n// =\u003e 'json'\n```\n\nTo get meta information for a mime type:\n\n```typescript\nimport { get } from 'mime-explorer';\n\nget('text/plain');\n/*\n{\n    \"source\": \"iana\",\n    \"compressible\": true,\n    \"extensions\": [\n        \"txt\",\n        \"text\",\n        \"conf\",\n        \"def\",\n        \"list\",\n        \"log\",\n        \"in\",\n        \"ini\"\n    ]\n}\n */\n\nget('application/json');\n/*\n{\n    \"source\": \"iana\",\n    \"charset\": \"UTF-8\",\n    \"compressible\": true,\n    \"extensions\": [\n        \"json\",\n        \"map\"\n    ]\n}\n */\n```\n\n## License\n\nMade with 💚\n\nPublished under [MIT License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftada5hi%2Fmime-explorer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftada5hi%2Fmime-explorer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftada5hi%2Fmime-explorer/lists"}