mimez

1.0.5 • Public • Published

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))

Readme

Keywords

Package Sidebar

Install

npm i mimez

Weekly Downloads

0

Version

1.0.5

License

MIT

Last publish

Collaborators

  • wallax