Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@paulcbetts/mime-db

jshttp15.8kMIT1.22.4

Media Type Database

mime, db, type, types, database, charset, charsets

readme

mime-db

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

This is a database of all mime types. 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 RawGit. It is recommended to replace master with a release tag as the JSON format may change in the future.

https://cdn.rawgit.com/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.json or src/custom-suffix.json.

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.

changelog

unreleased

  • Add application/vnd.3lightssoftware.imagescal
  • Add application/vnd.desmume.movie
  • Add video/encaprtp
  • Add video/h265
  • Add video/iso.segment
  • Add video/raptorfec
  • Add video/rtploopback
  • Add video/vnd.radgamettools.bink
  • Add video/vnd.radgamettools.smacker
  • Add video/vp8

1.22.0 / 2016-02-15

  • Add application/ppsp-tracker+json
  • Add application/problem+json
  • Add application/problem+xml
  • Add application/vnd.hdt
  • Add application/vnd.ms-printschematicket+xml
  • Add model/vnd.rosette.annotated-data-model
  • Add text/slim
  • Add extension .rng to application/xml
  • Fix extension of application/dash+xml to be .mpd
  • Update primary extension to .m4a for audio/mp4

1.21.0 / 2016-01-06

  • Add application/emergencycalldata.comment+xml
  • Add application/emergencycalldata.deviceinfo+xml
  • Add application/emergencycalldata.providerinfo+xml
  • Add application/emergencycalldata.serviceinfo+xml
  • Add application/emergencycalldata.subscriberinfo+xml
  • Add application/vnd.filmit.zfc
  • Add application/vnd.google-apps.document
  • Add application/vnd.google-apps.presentation
  • Add application/vnd.google-apps.spreadsheet
  • Add application/vnd.mapbox-vector-tile
  • Add application/vnd.ms-printdevicecapabilities+xml
  • Add application/vnd.ms-windows.devicepairing
  • Add application/vnd.ms-windows.nwprinting.oob
  • Add application/vnd.tml
  • Add audio/evs

1.20.0 / 2015-11-10

  • Add application/cdni
  • Add application/csvm+json
  • Add application/rfc+xml
  • Add application/vnd.3gpp.access-transfer-events+xml
  • Add application/vnd.3gpp.srvcc-ext+xml
  • Add application/vnd.ms-windows.wsd.oob
  • Add application/vnd.oxli.countgraph
  • Add application/vnd.pagerduty+json
  • Add text/x-suse-ymp

1.19.0 / 2015-09-17

  • Add application/vnd.3gpp-prose-pc3ch+xml
  • Add application/vnd.3gpp.srvcc-info+xml
  • Add application/vnd.apple.pkpass
  • Add application/vnd.drive+json

1.18.0 / 2015-09-03

  • Add application/pkcs12
  • Add application/vnd.3gpp-prose+xml
  • Add application/vnd.3gpp.mid-call+xml
  • Add application/vnd.3gpp.state-and-event-info+xml
  • Add application/vnd.anki
  • Add application/vnd.firemonkeys.cloudcell
  • Add application/vnd.openblox.game+xml
  • Add application/vnd.openblox.game-binary

1.17.0 / 2015-08-13

  • Add application/x-msdos-program
  • Add audio/g711-0
  • Add image/vnd.mozilla.apng
  • Add extension .exe to application/x-msdos-program

1.16.0 / 2015-07-29

  • Add application/vnd.uri-map

1.15.0 / 2015-07-13

  • Add application/x-httpd-php

1.14.0 / 2015-06-25

  • Add application/scim+json
  • Add application/vnd.3gpp.ussd+xml
  • Add application/vnd.biopax.rdf+xml
  • Add text/x-processing

1.13.0 / 2015-06-07

  • Add nginx as a source
  • Add application/x-cocoa
  • Add application/x-java-archive-diff
  • Add application/x-makeself
  • Add application/x-perl
  • Add application/x-pilot
  • Add application/x-redhat-package-manager
  • Add application/x-sea
  • Add audio/x-m4a
  • Add audio/x-realaudio
  • Add image/x-jng
  • Add text/mathml

1.12.0 / 2015-06-05

  • Add application/bdoc
  • Add application/vnd.hyperdrive+json
  • Add application/x-bdoc
  • Add extension .rtf to text/rtf

1.11.0 / 2015-05-31

  • Add audio/wav
  • Add audio/wave
  • Add extension .litcoffee to text/coffeescript
  • Add extension .sfd-hdstx to application/vnd.hydrostatix.sof-data
  • Add extension .n-gage to application/vnd.nokia.n-gage.symbian.install

1.10.0 / 2015-05-19

  • Add application/vnd.balsamiq.bmpr
  • Add application/vnd.microsoft.portable-executable
  • Add application/x-ns-proxy-autoconfig

1.9.1 / 2015-04-19

  • Remove .json extension from application/manifest+json
    • This is causing bugs downstream

1.9.0 / 2015-04-19

  • Add application/manifest+json
  • Add application/vnd.micro+json
  • Add image/vnd.zbrush.pcx
  • Add image/x-ms-bmp

1.8.0 / 2015-03-13

  • Add application/vnd.citationstyles.style+xml
  • Add application/vnd.fastcopy-disk-image
  • Add application/vnd.gov.sk.xmldatacontainer+xml
  • Add extension .jsonld to application/ld+json

1.7.0 / 2015-02-08

  • Add application/vnd.gerber
  • Add application/vnd.msa-disk-image

1.6.1 / 2015-02-05

  • Community extensions ownership transferred from node-mime

1.6.0 / 2015-01-29

  • Add application/jose
  • Add application/jose+json
  • Add application/json-seq
  • Add application/jwk+json
  • Add application/jwk-set+json
  • Add application/jwt
  • Add application/rdap+json
  • Add application/vnd.gov.sk.e-form+xml
  • Add application/vnd.ims.imsccv1p3

1.5.0 / 2014-12-30

  • Add application/vnd.oracle.resource+json
  • Fix various invalid MIME type entries
    • application/mbox+xml
    • application/oscp-response
    • application/vwg-multiplexed
    • audio/g721

1.4.0 / 2014-12-21

  • Add application/vnd.ims.imsccv1p2
  • Fix various invalid MIME type entries
    • application/vnd-acucobol
    • application/vnd-curl
    • application/vnd-dart
    • application/vnd-dxr
    • application/vnd-fdf
    • application/vnd-mif
    • application/vnd-sema
    • application/vnd-wap-wmlc
    • application/vnd.adobe.flash-movie
    • application/vnd.dece-zip
    • application/vnd.dvb_service
    • application/vnd.micrografx-igx
    • application/vnd.sealed-doc
    • application/vnd.sealed-eml
    • application/vnd.sealed-mht
    • application/vnd.sealed-ppt
    • application/vnd.sealed-tiff
    • application/vnd.sealed-xls
    • application/vnd.sealedmedia.softseal-html
    • application/vnd.sealedmedia.softseal-pdf
    • application/vnd.wap-slc
    • application/vnd.wap-wbxml
    • audio/vnd.sealedmedia.softseal-mpeg
    • image/vnd-djvu
    • image/vnd-svf
    • image/vnd-wap-wbmp
    • image/vnd.sealed-png
    • image/vnd.sealedmedia.softseal-gif
    • image/vnd.sealedmedia.softseal-jpg
    • model/vnd-dwf
    • model/vnd.parasolid.transmit-binary
    • model/vnd.parasolid.transmit-text
    • text/vnd-a
    • text/vnd-curl
    • text/vnd.wap-wml
  • Remove example template MIME types
    • application/example
    • audio/example
    • image/example
    • message/example
    • model/example
    • multipart/example
    • text/example
    • video/example

1.3.1 / 2014-12-16

  • Fix missing extensions
    • application/json5
    • text/hjson

1.3.0 / 2014-12-07

  • Add application/a2l
  • Add application/aml
  • Add application/atfx
  • Add application/atxml
  • Add application/cdfx+xml
  • Add application/dii
  • Add application/json5
  • Add application/lxf
  • Add application/mf4
  • Add application/vnd.apache.thrift.compact
  • Add application/vnd.apache.thrift.json
  • Add application/vnd.coffeescript
  • Add application/vnd.enphase.envoy
  • Add application/vnd.ims.imsccv1p1
  • Add text/csv-schema
  • Add text/hjson
  • Add text/markdown
  • Add text/yaml

1.2.0 / 2014-11-09

  • Add application/cea
  • Add application/dit
  • Add application/vnd.gov.sk.e-form+zip
  • Add application/vnd.tmd.mediaflex.api+xml
  • Type application/epub+zip is now IANA-registered

1.1.2 / 2014-10-23

  • Rebuild database for application/x-www-form-urlencoded change

1.1.1 / 2014-10-20

  • Mark application/x-www-form-urlencoded as compressible.

1.1.0 / 2014-09-28

  • Add application/font-woff2

1.0.3 / 2014-09-25

  • Fix engine requirement in package

1.0.2 / 2014-09-25

  • Add application/coap-group+json
  • Add application/dcd
  • Add application/vnd.apache.thrift.binary
  • Add image/vnd.tencent.tap
  • Mark all JSON-derived types as compressible
  • Update text/vtt data

1.0.1 / 2014-08-30

  • Fix extension ordering

1.0.0 / 2014-08-30

  • Add application/atf
  • Add application/merge-patch+json
  • Add multipart/x-mixed-replace
  • Add source: 'apache' metadata
  • Add source: 'iana' metadata
  • Remove badly-assumed charset data