file-mime
v0.0.13
Published
Basic MIME type mapping module.
Downloads
29
Readme
file-mime
Basic MIME type mapping module.
Installation
$ npm install file-mime
Running Tests
Install dev dependencies.
$ npm install
Run tests.
$ npm test
Check code quality.
$ npm run lint
Example
'use strict';
var mime = require('file-mime');
mime.type('json'); // => "application/json"
mime.find('json'); // => "application/json"
mime.lookup('json'); // => "application/json"
mime.extension('application/json'); // => "json"
mime.find('foo1'); // => false
mime.define('foo1', 'bar1'); // synonym for mime.defineOne
mime.find('foo1'); // => "bar1"
mime.find('foo2'); // => false
mime.find('foo3'); // => false
mime.define({ // synonym for mime.defineMore
'foo2': 'bar2',
'foo3': 'bar3'
});
mime.find('foo2'); // => "bar2"
mime.find('foo3'); // => "bar3"
License
MIT