file-mime

0.0.13 • Public • Published

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

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i file-mime

    Weekly Downloads

    2

    Version

    0.0.13

    License

    MIT

    Last publish

    Collaborators

    • gaborsar