Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    mimerpublic

    Mimer Build Status NPM version

    A simple MIME type getter built on top of Node.js.

    MODULE

    Browser version:: bower install mimer or Minified (amd and CommonJS ready) Source

    Node.js version: npm install mimer into your project

    Getting started

    // node and browserify
    var Mimer = require('mimer');
     
    // amd (Require.js and etc)
    require('path/to/mimer', function (Mimer) {});
     
    // browser (through script tag)
    window.Mimer

    Get a MIME type

    Mimer('file.css'); // => "text/css"
     
    // or
    var mime = new Mimer();
    mime.get('file.css');  // => "text/css"

    Set a MIME type

    var mime = new Mimer();
     
    mime.set('.monster', 'movie/thriller')
        .get('zombie.monster');
        // => "movie/thriller"
     
    mime.set(['.rctycoon','.simcity'], 'cms/game');
    mime.get('/land/park.rctycoon'); // => "cms/game"
    mime.get('maps/city.simcity'); // => "cms/game"

    CLIENT

    npm install -g mimer (it may require Root privileges)

    pritting a mime type

    $ mimer brand.png

    DEVELOPING

    $ make install
    $ make test

    Build web version with:

    $ make build

    If you'd like to test the full process including npm installer, just run:

    $ make fulltest

    Release notes

    • 0.3 - Remove potential REDOS vulnerability. Thanks to James Davis
    • 0.2 - Follow IANA RFC and full AMD and browser support
    • 0.1 - First release

    License

    MIT License (c) Helder Santana

    install

    npm i mimer

    Downloadsweekly downloads

    95,799

    version

    0.3.2

    license

    MIT

    repository

    github.com

    last publish

    collaborators

    • avatar
    • avatar
    • avatar