Socket
Book a DemoInstallSign in
Socket

iana-media-type

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iana-media-type

Collect IANA media types for you

0.1.46
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

iana-media-type

NPM Version

What is it for?

With iana-media-type, you can use IANA media types as JSON in your projects. It works in modern JavaScript runtimes.

We've provided a simple API for you. You can obtain iana-media-type from NPM. Please see the section "How to Obtain".

How to Obtain

  • iana-media-type provides an NPM package. You can install it with your favorite package managers, and then bundle it into your project.
Package ManagerCommandShorthand
bunbun install iana-media-typebun i iana-media-type
npmnpm install iana-media-typenpm i iana-media-type
pnpmpnpm install iana-media-typepnpm i iana-media-type
yarnyarn add iana-media-typeyarn add iana-media-type
curl -fsSL -o iana-media-type.json https://raw.githubusercontent.com/AsherJingkongChen/iana-media-type/main/index.json

Let's Learn How to Use It

  • Import the .js file:
import mediaTypes from 'iana-media-type/index.js';
console.log({ mediaTypes, length: mediaTypes.length });
  • Import the json file (Obtained from NPM) on node v19:
import mediaTypes from 'iana-media-type' assert { type: 'json' };
console.log({ mediaTypes, length: mediaTypes.length });
  • Import the json file (Obtained from NPM) on node 20+:
import mediaTypes from 'iana-media-type' with { type: 'json' };
console.log({ mediaTypes, length: mediaTypes.length });
  • Import the json file (Obtained from GitHub) in the browser or deno:
import mediaTypes from 'https://raw.githubusercontent.com/AsherJingkongChen/iana-media-type/main/index.json' with { type: 'json' };
console.log({ mediaTypes, length: mediaTypes.length });

Resources

Let's Setup the Project

Note: THIS section is for contributors and developers only

See What Dependencies We Are Using

See What Commands We Are Using

Package ManagerCommandScriptDescription
bun / npm / pnpminstallInstall dependencies
bun / npm / pnpmrunbuildBuild the JSON manifest
bun / npm / pnpmrunformatFormat files using Prettier

Be Aware of These Details

You may encounter some problems during development and deployment.

Please read the following notes carefully.

  • We provide the JSON file for backward compatibility and for situations where you don't want to evaluate code.
  • We are NOT IANA or IETF official. We are just a group of open-source developers.

Keywords

mime-type

FAQs

Package last updated on 29 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.