1.52.0 • Published 2 years ago

mime-db v1.52.0

Weekly downloads
39,334,863
License
MIT
Repository
github
Last release
2 years ago

mime-db

NPM Version NPM Downloads Node.js Version Build Status Coverage Status

This is a large database of mime types and information about them. It consists of a single, public JSON file and does not include any logic, allowing it to remain as un-opinionated as possible with an API. It aggregates data from the following sources:

Installation

npm install mime-db

Database Download

If you're crazy enough to use this in the browser, you can just grab the JSON file using jsDelivr. It is recommended to replace master with a release tag as the JSON format may change in the future.

https://cdn.jsdelivr.net/gh/jshttp/mime-db@master/db.json

Usage

var db = require('mime-db')

// grab data on .js files
var data = db['application/javascript']

Data Structure

The JSON file is a map lookup for lowercased mime types. Each mime type has the following properties:

  • .source - where the mime type is defined. If not set, it's probably a custom media type.
  • .extensions[] - known extensions associated with this mime type.
  • .compressible - whether a file of this type can be gzipped.
  • .charset - the default charset associated with this type, if any.

If unknown, every property could be undefined.

Contributing

To edit the database, only make PRs against src/custom-types.json or src/custom-suffix.json.

The src/custom-types.json file is a JSON object with the MIME type as the keys and the values being an object with the following keys:

  • compressible - leave out if you don't know, otherwise true/false to indicate whether the data represented by the type is typically compressible.
  • extensions - include an array of file extensions that are associated with the type.
  • notes - human-readable notes about the type, typically what the type is.
  • sources - include an array of URLs of where the MIME type and the associated extensions are sourced from. This needs to be a primary source; links to type aggregating sites and Wikipedia are not acceptable.

To update the build, run npm run build.

Adding Custom Media Types

The best way to get new media types included in this library is to register them with the IANA. The community registration procedure is outlined in RFC 6838 section 5. Types registered with the IANA are automatically pulled into this library.

If that is not possible / feasible, they can be added directly here as a "custom" type. To do this, it is required to have a primary source that definitively lists the media type. If an extension is going to be listed as associateed with this media type, the source must definitively link the media type and extension as well.

mime-typescompressibleext-listfree-minfhgushdhsdhfdhsgfhdlllllarchetype-librarycomponennentteasy-select-rn@navetacandra/wa-botchinjowwchinjowvuedragdropuploadimagesreact-native-bluetooth2killi8n-react-native-fast-imageextensible-node-serverrn-send-smsspecify-importsbabel-specify-importscad-cli@icanpm/api-master@arisageha/react-lazyload@arisageha/react-lazyload-fix@cashremit/cr-streamline-iconsreact-native-template-rfbaselittle-dev-serverairscanairscan-examplereadytest-testcafebb-chathomebridge-airmega-nathanfjohnsonreact-native-esc-pos-sahaab@borisovart/atol-kkt-module@frxf/frxf@phil8795/pecuniarius-api@moderno/serveresnext-serverplasma.mimedeneme323112storj-bridge@texttree/demo-bsa-reference-rcl@ntt_app/react-native-custom-notificationopenapi-mock-codegen-tsreact-native-custom-text-hwjames@easyboot/corediscordjs-factsdiscord-music-botsreact-native-covid-sdkanime-randomeasycommands-betagql_din_modeni-chatbitgetreact-native-thanh-toast-librarymutasi-bca@jttechnic/interpreter@thanhnguyen14797/react-native-thanh-toast-library@l1nyanm1ng/react-picture-vieweropenid-passportcthpb-plugin-social@fetch-plus/pluginsexpress-easy-static@olivervorasai/slidernpm-memesreact-native-printer-brothersrn-pdf-reader-offlinetypes-giscbmis-ai-toolboxreact-native-shekhar-bridge-testcogoportutilsukor-remasterdyx-reactlevibestliblevibestlib2levilibtest19levilibtest24levilibtest25levilibtest26levilibtest27levilibtest28levilibtest29talent-to-vite-cliwilscanner@oiti/documentoscopy-react-nativestretch-rollup@mink-opn/build-tokensqwackbotquoc-testreact-native-slider-kfnodejs-filesharesvelte-slimeunblock-block-save-variableshexa-node-common@infinitebrahmanuniverse/nolb-mim@prodam/prodam-typescclibyarntest@saaspe/componentshyperpass-sdkplginnpmasdaysdgasjhdhjasdghjasdjhsjsdgfhdsghjfdhjdfghdfhgfdjhgdfhgh
1.52.0

2 years ago

1.51.0

2 years ago

1.50.0

3 years ago

1.49.0

3 years ago

1.48.0

3 years ago

1.47.0

3 years ago

1.46.0

3 years ago

1.45.0

4 years ago

1.44.0

4 years ago

1.43.0

4 years ago

1.42.0

5 years ago

1.41.0

5 years ago

1.40.0

5 years ago

1.39.0

5 years ago

1.38.0

5 years ago

1.37.0

5 years ago

1.36.0

6 years ago

1.35.0

6 years ago

1.34.0

6 years ago

1.33.0

6 years ago

1.32.0

6 years ago

1.31.0

6 years ago

1.30.0

7 years ago

1.29.0

7 years ago

1.28.0

7 years ago

1.27.0

7 years ago

1.26.0

7 years ago

1.25.0

7 years ago

1.24.0

8 years ago

1.23.0

8 years ago

1.22.0

8 years ago

1.21.0

8 years ago

1.20.0

8 years ago

1.19.0

9 years ago

1.18.0

9 years ago

1.17.0

9 years ago

1.16.0

9 years ago

1.15.0

9 years ago

1.14.0

9 years ago

1.13.0

9 years ago

1.12.0

9 years ago

1.11.0

9 years ago

1.10.0

9 years ago

1.9.1

9 years ago

1.9.0

9 years ago

1.8.0

9 years ago

1.7.0

9 years ago

1.6.1

9 years ago

1.6.0

9 years ago

1.5.0

9 years ago

1.4.0

9 years ago

1.3.1

9 years ago

1.3.0

9 years ago

1.2.0

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.0.0

10 years ago