A comprehensive, dependency-free JavaScript library for MIME type and file extension mapping.
Mime is a JavaScript library that provides a comprehensive API for mapping between file extensions and MIME types. It solves the problem of accurately determining content types for files in web applications, servers, and build tools, ensuring proper handling and serving of diverse file formats.
Node.js and JavaScript developers building web servers, file processing utilities, static site generators, or any application that needs to infer or set MIME types based on file extensions.
Developers choose Mime for its completeness (covering all `mime-db` types), zero dependencies, and straightforward API, making it a reliable and lightweight alternative to larger or less maintained MIME type libraries.
Mime types for JavaScript
Includes all mime-db types with over 800 MIME types and 1,000+ extensions, ensuring support for virtually any file format in web and server contexts.
Has no external dependencies, resulting in minimal bundle size and avoiding dependency conflicts or bloat common in other libraries.
Provides full TypeScript types out of the box, eliminating the need for separate @types packages and enhancing developer experience with auto-completion.
Offers a drop-in lite version that excludes unofficial types (e.g., 'prs.*', 'x-*'), allowing for smaller builds when full coverage isn't required.
Version 4 introduces breaking changes from v3, such as no direct property imports and an immutable default object, which can disrupt upgrades and require code adjustments.
Requires ESM module support and ES2020 runtime, limiting compatibility with older CommonJS-based projects or environments without modern JavaScript support.
Only maps file extensions to MIME types and cannot detect types from file content, making it unsuitable for files without extensions or with mismatched data.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.