Skip to content

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

License

Notifications You must be signed in to change notification settings

fabiospampinato/ext2mime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published