Skip to content

fabiospampinato/ext2mime

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 

Ext2Mime

Convert a file extension to a mime type. It works only with popular file extensions and it's super lightweight.

This is basically the inverse of mime2ext.

Install

npm install --save ext2mime

Usage

import ext2mime from 'ext2mime';

ext2mime ( 'mp3' ); // => 'audio/mpeg'
ext2mime ( '.mp3' ); // => 'audio/mpeg'

License

MIT © Fabio Spampinato