ext2mime
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

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 ext2mime

Usage

import ext2mime from 'ext2mime';

// Let's convert some file extensions to mime types

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

License

MIT © Fabio Spampinato

Package Sidebar

Install

npm i ext2mime

Weekly Downloads

5

Version

2.0.1

License

MIT

Unpacked Size

3.4 kB

Total Files

7

Last publish

Collaborators

  • fabiospampinato