npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

mime-types-lite

v1.7.2

Published

A collection of common MIME types for use in applications.

Readme

mime-types-lite

The mime-types-lite is a lightweight and comprehensive utility providing standardized MIME types for applications. It simplifies the handling of file format identification by offering predefined constants, ensuring clarity and consistency in file processing and serving.

Table of Contents


Key Features

  1. Predefined MIME Types: Provides a comprehensive set of MIME types for easy reference.
  2. TypeScript Support: Includes strong type definitions for enhanced code safety and developer experience.
  3. Immutable Constants: Ensures MIME types cannot be modified, preventing unintended changes.
  4. Lightweight & Efficient: Minimal footprint with high performance.
  5. Easy Integration: Seamlessly integrates with any Node.js or TypeScript-based project.

Installation

To install the package, run the following command:

npm install mime-types-lite

or

yarn add mime-types-lite

or

pnpm add mime-types-lite

or

bun add mime-types-lite

Usage

JavaScript CommonJS Example

const mimeTypesLite = require('mime-types-lite');

console.log(mimeTypesLite.JSON); // Outputs: application/json

JavaScript ESM Example

import mimeTypesLite from 'mime-types-lite';

console.log(mimeTypesLite.JSON); // Outputs: application/json

// TypeScript example:
import mimeTypesLite from 'mime-types-lite';

const fileType = 'JSON';
console.log(mimeTypesLite[fileType]); // Outputs: application/json

TypeScript ESM Example

import mimeTypesLite, { MimeType } from 'mime-types-lite';

console.log(mimeTypesLite.JSON); // Outputs: application/json

// TypeScript example:
const fileType: MimeType = 'JSON';
console.log(mimeTypesLite[fileType]); // Outputs: application/json

Supported MIME Types

Document MIME Types

  • EPUB: application/epub+zip
  • TEX: application/x-tex
  • PPT: application/vnd.ms-powerpoint
  • PPTX: application/vnd.openxmlformats-officedocument.presentationml.presentation
  • ODT: application/vnd.oasis.opendocument.text
  • ODS: application/vnd.oasis.opendocument.spreadsheet
  • RTF: application/rtf
  • DOC: application/msword
  • DOCX: application/vnd.openxmlformats-officedocument.wordprocessingml.document
  • XLS: application/vnd.ms-excel
  • XLSX: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  • PDF: application/pdf
  • MD: text/markdown
  • TXT: text/plain
  • CSV: text/csv

Image MIME Types

  • XCF: image/x-xcf
  • PSD: image/vnd.adobe.photoshop
  • JP2: image/jp2
  • AVIF: image/avif
  • HEIC: image/heic
  • WEBP: image/webp
  • JPG: image/jpeg
  • JPEG: image/jpeg
  • PNG: image/png
  • ICO: image/x-icon
  • GIF: image/gif
  • BMP: image/bmp
  • TIFF: image/tiff
  • SVG: image/svg+xml

Video MIME Types

  • MKV: video/x-matroska
  • FLV: video/x-flv
  • WMV: video/x-ms-wmv
  • MOV: video/quicktime
  • WEBM: video/webm
  • AVI: video/avi
  • MPEG: video/mpeg
  • MP4: video/mp4

Audio MIME Types

  • AMR: audio/amr
  • MIDI: audio/midi
  • FLAC: audio/flac
  • OGG: audio/ogg
  • AAC: audio/aac
  • MP3: audio/mpeg
  • WAV: audio/wav

Archive MIME Types

  • TAR: application/x-tar
  • GZ: application/gzip
  • SEVEN_ZIP: application/x-7z-compressed
  • ZIP: application/zip
  • RAR: application/vnd.rar
  • BZ2: application/x-bzip2

Web-related MIME Types

  • ICS: text/calendar
  • ATOM: application/atom+xml
  • RSS: application/rss+xml
  • WASM: application/wasm
  • YAML: application/x-yaml
  • GRAPHQL: application/graphql
  • URL_ENCODED: application/x-www-form-urlencoded
  • JSON: application/json
  • XML: application/xml
  • JS: application/javascript
  • CSS: text/css
  • HTML: text/html

Font MIME Types

  • WOFF: font/woff
  • WOFF2: font/woff2
  • TTF: font/ttf
  • OTF: font/otf

License

by-nc-nd/4.0

This project is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).

You are free to:

  • Share — Copy and redistribute the material in any medium or format.

Under the following terms:

  • Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made.
  • NonCommercial — You may not use the material for commercial purposes.
  • NoDerivatives — If you remix, transform, or build upon the material, you may not distribute the modified material.

For more details, please visit the Creative Commons License Page.


Acknowledgments

Special thanks to the following resources:

  1. MDN Web Docs - Comprehensive MIME type references.
  2. Node.js Express Documentation - Guidance on handling MIME types in HTTP responses.
  3. TypeScript Docs - Best practices for defining and using type-safe constants.

FAQs

1. How do I determine the correct MIME type for my file?

MIME types are categorized based on their format. Documents, images, videos, audio, and archives each have their respective MIME types. Refer to the Supported MIME Types section for details.

2. Can I extend this library with custom MIME types?

No, the constants are immutable and follow the official MIME type standards. If needed, you can create a wrapper module to include your custom MIME types.

3. How do I uninstall the package?

You can remove the package by running:

npm uninstall mime-types-lite

or

yarn remove mime-types-lite

or

pnpm remove mime-types-lite

or

bun remove mime-types-lite

Author