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 🙏

© 2026 – Pkg Stats / Ryan Hefner

mimetypes-wildcard

v1.0.1

Published

Validates wildcard MIME Types using the data in the mime-types package.

Readme

mimetypes-wildcard

mimetypes-wildcard is a library that checks if a subtype MIME exists in a main MIME type. For example, this library can be used if your server has a wildcard (*) for what mime-types it accepts.

Types and Subtypes

A MIME type is a string that shows what type of file the thing is. For example, an MP4 file would have the video/mp4 MIME type. The 'video' on the video/mp4 MIME type is the type. The type is the main thing that describes a file. An MP4 file is a video, so the main type is a video. A subtype describes what type of file it is. An MP4 file is a video with the mp4 file type; so the MIME type would be video/mp4.

API

Validator(type) contructor

The Validator constructor is a constructor that takes a type and has a function that returns true or false if a MIME exists.

new Validator(type)

Example

const video = new Validator('video')
// the video var has a validate() function on it

validate(subtype)

The validate() function returns a boolean type when you give it a subtype. You can use this function to check if the subtype MIME exists under the main type MIME.

Example

const video = new Validator('video')
const check = video.validate('mp4')
// The check var returns true since the mp4 subtype exists under the video type. That would be video/mp4.

Executable Example in Node.js

const { default: Validator } = require("mimetypes-wildcard");
// This stores the Validator object into the video var
const video = new Validator('video')
// This stores the boolean value from the validator
const validate = video.validate('mp4')
// This should print true since the mp4 subtype exists under the video type.
console.log(validate)