All Projects → jshttp → Mime Db

jshttp / Mime Db

Licence: mit
Media Type Database

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Mime Db

Mime Types
The ultimate javascript content-type utility.
Stars: ✭ 865 (+41.34%)
Mutual labels:  mime, mime-types
Mime
Shared MIME-info database in D programming language
Stars: ✭ 7 (-98.86%)
Mutual labels:  mime, mime-types
ruby-magic
Simple interface to libmagic for Ruby Programming Language
Stars: ✭ 23 (-96.24%)
Mutual labels:  mime, mime-types
mimesniff
MIME Sniffing Standard
Stars: ✭ 89 (-85.46%)
Mutual labels:  mime, mime-types
Swime
🗂 Swift MIME type checking based on magic bytes
Stars: ✭ 119 (-80.56%)
Mutual labels:  mime, mime-types
Filetype
Fast, dependency-free, small Go package to infer the binary file type based on the magic numbers signature
Stars: ✭ 1,278 (+108.82%)
Mutual labels:  mime, mime-types
Mime
.NET wrapper for libmagic
Stars: ✭ 51 (-91.67%)
Mutual labels:  mime, mime-types
Mime
The Hoa\Mime library.
Stars: ✭ 100 (-83.66%)
Mutual labels:  mime, mime-types
Fileio.jl
Main Package for IO, loading all different kind of files
Stars: ✭ 133 (-78.27%)
Mutual labels:  mime, mime-types
Mimetype
A fast golang library for MIME type and file extension detection, based on magic numbers
Stars: ✭ 452 (-26.14%)
Mutual labels:  mime, mime-types
mimesniffer
A MIME type sniffer for Go.
Stars: ✭ 22 (-96.41%)
Mutual labels:  mime
mimeparse-php
Basic functions for handling mime-types, forked from Joe Gregorio's mimeparse library
Stars: ✭ 38 (-93.79%)
Mutual labels:  mime
fs2-mail
asynchronous library for sending and receiving mail via fs2._
Stars: ✭ 39 (-93.63%)
Mutual labels:  mime
AdES
An Implementation of CAdES, XAdES, PAdES and ASiC for Windows in C++
Stars: ✭ 29 (-95.26%)
Mutual labels:  mime
Ruby Mime Types
Ruby MIME type registry library
Stars: ✭ 288 (-52.94%)
Mutual labels:  mime-types
MimeTypesMap
Simple dictionary provides a few methods to lookup mime type/extension, generated From Apache's mime.types.
Stars: ✭ 25 (-95.92%)
Mutual labels:  mime-types
CommonCrawlDocumentDownload
A small tool which uses the CommonCrawl URL Index to download documents with certain file types or mime-types. This is used for mass-testing of frameworks like Apache POI and Apache Tika
Stars: ✭ 43 (-92.97%)
Mutual labels:  mime-types
Mailkit
A cross-platform .NET library for IMAP, POP3, and SMTP.
Stars: ✭ 4,477 (+631.54%)
Mutual labels:  mime
Filetype.py
Small, dependency-free, fast Python package to infer binary file types checking the magic numbers signature
Stars: ✭ 275 (-55.07%)
Mutual labels:  mime
mimetypes
Erlang MIME types library
Stars: ✭ 77 (-87.42%)
Mutual labels:  mime-types

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 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/[email protected]/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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].