socketioMEANseed/server/node_modules/mime-db/README.md
server/node_modules/mime-db/README.mdRaw
1# mime-db
2
3[![NPM Version][npm-version-image]][npm-url]
4[![NPM Downloads][npm-downloads-image]][npm-url]
5[![Node.js Version][node-image]][node-url]
6[![Build Status][travis-image]][travis-url]
7[![Coverage Status][coveralls-image]][coveralls-url]
8
9This is a database of all mime types.
10It consists of a single, public JSON file and does not include any logic,
11allowing it to remain as un-opinionated as possible with an API.
12It aggregates data from the following sources:
13
14- http://www.iana.org/assignments/media-types/media-types.xhtml
15- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
16
17## Installation
18
19```bash
20npm install mime-db
21```
22
23If you're crazy enough to use this in the browser,
24you can just grab the JSON file:
25
26```
27https://cdn.rawgit.com/jshttp/mime-db/master/db.json
28```
29
30## Usage
31
32```js
33var db = require('mime-db');
34
35// grab data on .js files
36var data = db['application/javascript'];
37```
38
39## Data Structure
40
41The JSON file is a map lookup for lowercased mime types.
42Each mime type has the following properties:
43
44- `.source` - where the mime type is defined.
45 If not set, it's probably a custom media type.
46 - `apache` - [Apache common media types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types)
47 - `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml)
48- `.extensions[]` - known extensions associated with this mime type.
49- `.compressible` - whether a file of this type is can be gzipped.
50- `.charset` - the default charset associated with this type, if any.
51
52If unknown, every property could be `undefined`.
53
54## Contributing
55
56To edit the database, only make PRs against `src/custom.json` or
57`src/custom-suffix.json`.
58
59To update the build, run `npm run update`.
60
61## Adding Custom Media Types
62
63The best way to get new media types included in this library is to register
64them with the IANA. The community registration procedure is outlined in
65[RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types
66registered with the IANA are automatically pulled into this library.
67
68[npm-version-image]: https://img.shields.io/npm/v/mime-db.svg
69[npm-downloads-image]: https://img.shields.io/npm/dm/mime-db.svg
70[npm-url]: https://npmjs.org/package/mime-db
71[travis-image]: https://img.shields.io/travis/jshttp/mime-db/master.svg
72[travis-url]: https://travis-ci.org/jshttp/mime-db
73[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-db/master.svg
74[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master
75[node-image]: https://img.shields.io/node/v/mime-db.svg
76[node-url]: http://nodejs.org/download/