iana-media-type
v0.1.24
Published
Collect IANA media types for you
Downloads
173
Maintainers
Readme
iana-media-type
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 Manager | Command | Shorthand |
| ----------------------------- | ------------------------------ | -------------------------- |
| bun | bun install iana-media-type
| bun i iana-media-type
|
| npm | npm install iana-media-type
| npm i iana-media-type
|
| pnpm | pnpm install iana-media-type
| pnpm i iana-media-type
|
| yarn | yarn add iana-media-type
| yarn add iana-media-type
|
iana-media-type
provides a JSON file on the GitHub. You can download it and use it in your project.
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 json file
(Obtained from NPM)
import mediaTypes from 'iana-media-type' assert { type: 'json' };
console.log({ mediaTypes, length: mediaTypes.length });
- Import the json file
(Obtained from GitHub)
import mediaTypes from './iana-media-type.json' assert { type: 'json' };
console.log({ mediaTypes, length: mediaTypes.length });
Resources
Let's Setup the Project
Note: THIS section is for contributors and developers only
Recommended IDE Setup for You
- IDEs:
- Extensions:
See What Dependencies We Are Using
- Environments
- Linters
See What Commands We Are Using
| Package Manager | Command | Script | Description |
| ---------------------- | --------- | -------- | --------------------------- |
| bun
/ npm
/ pnpm
| install
| | Install dependencies |
| bun
/ npm
/ pnpm
| run
| build
| Build the JSON manifest |
| bun
/ npm
/ pnpm
| run
| format
| Format files using Prettier |
Be Aware of These Details
You may encounter some problems during development and deployment.
Please read the following notes carefully.
- We only provide a JSON file, so you won't evaluate this module.
- We are NOT IANA or IETF official. We are just a group of open-source developers.