mime-db / 1.23.0 last updated 3 months ago created on Aug 14th 2014

Install

npm install --save mime-db

Clone

git clone git@github.com:jshttp/mime-db.git

dependencies

No dependencies listed.

maintainers

dougwilson dougwilson
jongleberry

versions 33 total

1.23.0 3 months ago dougwilson
1.22.0 6 months ago dougwilson
1.21.0 7 months ago dougwilson
1.20.0 9 months ago dougwilson
1.19.0 10 months ago dougwilson
1.18.0 a year ago dougwilson
1.17.0 a year ago dougwilson
1.16.0 a year ago dougwilson
1.15.0 a year ago dougwilson
1.14.0 a year ago dougwilson
1.13.0 a year ago dougwilson
1.12.0 a year ago dougwilson
1.11.0 a year ago dougwilson
1.10.0 a year ago dougwilson
1.9.1 a year ago dougwilson
1.9.0 a year ago dougwilson
1.8.0 a year ago dougwilson
1.7.0 a year ago dougwilson
1.6.1 a year ago dougwilson
1.6.0 2 years ago dougwilson
1.5.0 2 years ago dougwilson
1.4.0 2 years ago dougwilson
1.3.1 2 years ago dougwilson
1.3.0 2 years ago dougwilson
1.2.0 2 years ago dougwilson
1.1.2 2 years ago dougwilson
1.1.1 2 years ago jongleberry
1.1.0 2 years ago dougwilson
1.0.3 2 years ago dougwilson
1.0.2 2 years ago dougwilson
1.0.1 2 years ago jongleberry
1.0.0 2 years ago jongleberry
0.0.0 2 years ago jongleberry
246813 Downloads yesterday.

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

1
2
3
4
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.

Resolving all dependencies.. This could take a while as our cache is not yet fully warmed up.