{"id":24794882,"url":"https://github.com/montasim/content-types-lite","last_synced_at":"2026-03-10T23:35:23.179Z","repository":{"id":274802252,"uuid":"924067910","full_name":"montasim/content-types-lite","owner":"montasim","description":"The content-types-lite is a lightweight and structured utility providing standardized content types (MIME types) for various applications. It simplifies content type handling by offering predefined constants, ensuring consistency in file processing, API responses, and HTTP headers.","archived":false,"fork":false,"pushed_at":"2026-02-28T11:24:23.000Z","size":935,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-28T15:41:05.587Z","etag":null,"topics":["content","content-db","content-types","contenttypes","lite","npm-package","type","types","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/content-types-lite","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/montasim.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-29T11:05:22.000Z","updated_at":"2026-02-28T11:24:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"c45fdcd1-d4c2-44f7-b5fd-2717c7a9ca33","html_url":"https://github.com/montasim/content-types-lite","commit_stats":null,"previous_names":["montasim/content-types-lite"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/montasim/content-types-lite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/montasim%2Fcontent-types-lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/montasim%2Fcontent-types-lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/montasim%2Fcontent-types-lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/montasim%2Fcontent-types-lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/montasim","download_url":"https://codeload.github.com/montasim/content-types-lite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/montasim%2Fcontent-types-lite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30362121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"ssl_error","status_checked_at":"2026-03-10T21:40:59.357Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["content","content-db","content-types","contenttypes","lite","npm-package","type","types","typescript"],"created_at":"2025-01-29T23:18:38.563Z","updated_at":"2026-03-10T23:35:23.136Z","avatar_url":"https://github.com/montasim.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# content-types-lite\n\n\u003c!-- repository summary badges start --\u003e\n\u003cdiv\u003e\n    \u003cimg alt=\"NPM Version\" src=\"https://badgen.net/npm/v/content-types-lite?label=version\u0026labelColor=EB008B\u0026color=00B8B5\"\u003e\n    \u003cimg alt=\"NPM Downloads\" src=\"https://badgen.net/npm/dm/content-types-lite?label=downloads\u0026labelColor=EB008B\u0026color=00B8B5\"\u003e\n    \u003cimg alt=\"NPM Package\" src=\"https://badgen.net/npm/license/content-types-lite?label=license\u0026labelColor=EB008B\u0026color=00B8B5\"\u003e\n\u003c/div\u003e\n\u003c!-- repository summary badges end --\u003e\n\nThe [content-types-lite](https://www.npmjs.com/package/content-types-lite) is a lightweight and structured utility providing standardized content types (MIME types) for various applications. It simplifies content type handling by offering predefined constants, ensuring consistency in file processing, API responses, and HTTP headers.\n\n## Table of Contents\n\n- [Key Features](#key-features)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Supported Content Types](#supported-content-types)\n- [License](#license)\n- [Acknowledgments](#acknowledgments)\n- [FAQs](#faqs)\n\n---\n\n## Key Features\n\n1. **Predefined Content Types:** A comprehensive set of MIME types categorized for different use cases.\n2. **TypeScript Support:** Strong type definitions for better development experience and safety.\n3. **Immutable Constants:** Prevents modifications to ensure consistency.\n4. **Lightweight \u0026 Efficient:** Optimized for performance with a minimal footprint.\n5. **Seamless Integration:** Works with any Node.js or TypeScript-based project.\n\n---\n\n## Installation\n\nTo install the package, run the following command:\n\n```bash\nnpm install content-types-lite\n```\n\nor\n\n```bash\nyarn add content-types-lite\n```\n\nor\n\n```bash\npnpm add content-types-lite\n```\n\nor\n\n```bash\nbun add content-types-lite\n```\n\n---\n\n## Usage\n\n### JavaScript CommonJS Example\n\n```javascript\nconst contentTypesLite = require('content-types-lite');\n\nconsole.log(contentTypesLite.JSON); // Outputs: application/json\n```\n\n### JavaScript ESM Example\n\n```javascript\nimport contentTypesLite from 'content-types-lite';\n\nconsole.log(contentTypesLite.JSON); // Outputs: application/json\n\nconst fileType = 'JSON';\nconsole.log(contentTypesLite[fileType]); // Outputs: application/json\n```\n\n### TypeScript ESM Example\n\n```typescript\nimport contentTypesLite, { ContentType } from 'content-types-lite';\n\nconsole.log(contentTypesLite.JSON); // Outputs: application/json\n\nconst fileType: ContentType = 'JSON';\nconsole.log(contentTypesLite[fileType]); // Outputs: application/json\n```\n\n---\n\n## Supported Content Types\n\n### **Text-Based Content Types**\n\n- `PLAIN_TEXT`: `text/plain`\n- `HTML`: `text/html`\n- `CSS`: `text/css`\n- `CSV`: `text/csv`\n- `XML`: `text/xml`\n- `MARKDOWN`: `text/markdown`\n- `RICH_TEXT`: `text/richtext`\n\n### **Structured Data Formats**\n\n- `JSON`: `application/json`\n- `XML_APP`: `application/xml`\n- `YAML`: `application/x-yaml`\n- `FORM_URLENCODED`: `application/x-www-form-urlencoded`\n- `NDJSON`: `application/x-ndjson`\n- `MSGPACK`: `application/x-msgpack`\n- `PROTOBUF`: `application/x-protobuf`\n\n### **Multipart \u0026 Form Data**\n\n- `MULTIPART_FORM_DATA`: `multipart/form-data`\n- `MULTIPART_MIXED`: `multipart/mixed`\n- `MULTIPART_ALTERNATIVE`: `multipart/alternative`\n- `MULTIPART_DIGEST`: `multipart/digest`\n- `MULTIPART_RELATED`: `multipart/related`\n- `MULTIPART_SIGNED`: `multipart/signed`\n- `MULTIPART_ENCRYPTED`: `multipart/encrypted`\n\n### **Binary \u0026 File Upload Content Types**\n\n- `OCTET_STREAM`: `application/octet-stream`\n- `PDF`: `application/pdf`\n- `ZIP`: `application/zip`\n- `GZIP`: `application/gzip`\n- `MSWORD`: `application/msword`\n- `DOCX`: `application/vnd.openxmlformats-officedocument.wordprocessingml.document`\n- `EXCEL`: `application/vnd.ms-excel`\n- `XLSX`: `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`\n- `POWERPOINT`: `application/vnd.ms-powerpoint`\n- `PPTX`: `application/vnd.openxmlformats-officedocument.presentationml.presentation`\n\n### **Media Content Types**\n\n- `GIF`: `image/gif`\n- `PNG`: `image/png`\n- `JPEG`: `image/jpeg`\n- `WEBP`: `image/webp`\n- `SVG`: `image/svg+xml`\n- `HEIF`: `image/heif`\n- `AVIF`: `image/avif`\n\n### **Streaming \u0026 Event Content Types**\n\n- `EVENT_STREAM`: `text/event-stream`\n- `TAR`: `application/x-tar`\n- `BZIP2`: `application/x-bzip2`\n\n---\n\n## License\n\n[![by-nc-nd/4.0](https://licensebuttons.net/l/by-nc-nd/4.0/88x31.png)](https://creativecommons.org/licenses/by-nc-nd/4.0/)\n\nThis project is licensed under the **Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)**.\n\n### You are free to:\n\n- **Share** — Copy and redistribute the material in any medium or format.\n\n### Under the following terms:\n\n- **Attribution** — You must give appropriate credit, provide a link to the license, and indicate if changes were made.\n- **NonCommercial** — You may not use the material for commercial purposes.\n- **NoDerivatives** — If you remix, transform, or build upon the material, you may not distribute the modified material.\n\nFor more details, please visit the [Creative Commons License Page](https://creativecommons.org/licenses/by-nc-nd/4.0/).\n\n---\n\n## Acknowledgments\n\nSpecial thanks to the following resources:\n\n1. **MDN Web Docs** - Comprehensive MIME type references.\n2. **Node.js Express Documentation** - Guidance on handling content types in HTTP responses.\n3. **TypeScript Docs** - Best practices for defining and using type-safe constants.\n\n---\n\n## FAQs\n\n### 1. **How do I determine the correct content type for my file?**\n\nContent types are categorized based on their format. Documents, images, videos, and binary files each have their respective content types. Refer to the [Supported Content Types](#supported-content-types) section for details.\n\n### 2. **Can I extend this library with custom content types?**\n\nNo, the constants are immutable and follow the official content type standards. If needed, you can create a wrapper module to include your custom content types.\n\n### 3. **How do I uninstall the package?**\n\nYou can remove the package by running:\n\n```bash\nnpm uninstall content-types-lite\n```\n\nor\n\n```bash\nyarn remove content-types-lite\n```\n\nor\n\n```bash\npnpm remove content-types-lite\n```\n\nor\n\n```bash\nbun remove content-types-lite\n```\n\n---\n\n## Author\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\n      \u003cimg src=\"https://avatars.githubusercontent.com/u/95298623?v=4\" width=\"100px\" alt=\"Moon\"\u003e\n      \u003ca href=\"https://github.com/montasim\"\u003e\n        \u003cbr\u003e\n          Ｍ♢ＮＴΛＳＩＭ\n        \u003cbr\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmontasim%2Fcontent-types-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmontasim%2Fcontent-types-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmontasim%2Fcontent-types-lite/lists"}