Skip to content

getMime

传入文件格式后缀,返回mime type

API

Return

参数说明类型
string返回mime typestring

Options

参数说明类型默认值
ext文件后缀格式string

Example

js
import { getMime } from 'ranuts';

const result = getMime('.pptx');
console.log(result);
// 'application/vnd.openxmlformats-officedocument.presentationml.presentation
const res = getMime('.txt');
console.log(result);
// text/plain

Released under the MIT License.