ext-mime
v0.0.2
Published
mime types for filename extensions
Downloads
168
Maintainers
Readme
ext-mime
mime types for filename extension
Install
npm install ext-mime
Usage
const extMime = require('ext-mime');
console.log(extMime('txt')); // ['text/plain']
console.log(extMime('html')); // ['text/html']
console.log(extMime('jpeg')); // ['image/jpeg']
console.log(extMime('jpg')); // ['image/jpeg']
console.log(extMime('js')); // ['application/javascript']
console.log(extMime('xml')); // ['application/xml']
console.log(extMime('xls')); // ['application/vnd.ms-excel']
console.log(extMime('wmz')); // ['application/x-msmetafile', 'application/x-ms-wmz']
console.log(extMime('nonexistent')); // []
Test
npm test
Resources
Use mime-ext
for finding filename extensions for mime type.
License
MIT