ext-name

Get the file extension and MIME type from a file

MIT 9 个版本
安装
npm install ext-name
yarn add ext-name
pnpm add ext-name
bun add ext-name
README

ext-name Build Status

Get the file extension and MIME type from a file

Install

$ npm install --save ext-name

Usage

const extName = require('ext-name');

console.log(extName('foobar.tar'));
//=> [{ext: 'tar', mime: 'application/x-tar'}]

console.log(extName.mime('application/x-tar'));
//=> [{ext: 'tar', mime: 'application/x-tar'}]

API

extName(filename)

Returns an Array with objects with the file extension and MIME type.

filename

Type: string

Get the extension and MIME type from a filename.

extName.mime(mimetype)

Returns an Array with objects with the file extension and MIME type.

mimetype

Type: string

Get the extension and MIME type from a MIME type.

License

MIT © Kevin Mårtensson

版本列表
5.0.0 2017-06-07
4.1.0 2017-05-22
4.0.0 2016-05-21
3.0.0 2015-04-09
2.2.0 2015-04-09
2.0.2 2014-11-02
2.0.1 2014-10-28
2.0.0 2014-10-24
1.0.1 2014-08-31