0.1.31 • Published 4 months ago

iana-media-type v0.1.31

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

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

  1. Import the .js file:
import mediaTypes from 'iana-media-type/index.js';
console.log({ mediaTypes, length: mediaTypes.length });
  1. 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 });
  1. 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 });
  1. 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

Recommended IDE Setup for You

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.

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

5 months ago

0.1.31

4 months ago

0.1.27

7 months ago

0.1.28

6 months ago

0.1.29

6 months ago

0.1.24

9 months ago

0.1.25

8 months ago

0.1.26

7 months ago

0.1.23

9 months ago

0.1.20

10 months ago

0.1.21

10 months ago

0.1.22

10 months ago

0.1.18

11 months ago

0.1.19

11 months ago

0.1.12

1 year ago

0.1.13

1 year ago

0.1.14

1 year ago

0.1.15

1 year ago

0.1.16

12 months ago

0.1.17

11 months ago

0.1.11

1 year ago

0.1.10

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.0.11

1 year ago

0.0.12

1 year ago

0.1.0

1 year ago

0.1.1

1 year ago

0.0.3

1 year ago

0.0.10

1 year ago

0.0.2

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.0

1 year ago