云盘
志元云盘
备份云盘
Home
/
志元云盘
/
webdav
/
home
/
jcore
/
web
/
front_end
/
node_modules
/
ext-name
File
OriginalPic
Thumbnails
CopyAllDownloadUrl
EditTime
Size
index.js
2017-06-08 00:10:41
579 B
license
2017-05-22 19:06:02
1.08 KB
package.json
2017-06-08 00:11:07
617 B
readme.md
2017-06-07 19:56:36
1.07 KB
# ext-name [](https://travis-ci.org/kevva/ext-name) > Get the file extension and MIME type from a file ## Install ``` $ npm install --save ext-name ``` ## Usage ```js 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. ## Related * [ext-name-cli](https://github.com/kevva/ext-name-cli) - CLI for this module * [file-type](https://github.com/sindresorhus/file-type) - Detect the file type of a Buffer/Uint8Array ## License MIT © [Kevin Mårtensson](https://github.com/kevva)
2025-09-02 05:17:40 Tuesday 216.73.216.107 Runningtime:0.013s Mem:1.48 MB