1.0.5 • Published 8 years ago

mimez v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

Mimez

A mimetype parser

Install

npm install mimez

Usage

First, add your custom mimetype,

If not match the mimetype, return the 'application/octec-stream'

Custom mimetype

Edit mimetype.json, type format like this:

"mimetype": exts

example:

"text/html": ["html", "htm"]

Include

var mimez = require('mimez')

API

By extname

var str = 'css'
console.log(mimez.ext(str))

By path

var str = '/root/res/style.css'
console.log(mimez.path(str))

By url

var str = 'http://example.com/welcome.htm'
console.log(mimez.url(str))