安装
npm i file-type
示例
const FileType = require('file-type'); (async () => { console.log(await FileType.fromFile('baidu.jp')); //=> {ext: 'png', mime: 'image/png'} })();
参考
【实战】JavaScript 如何检测文件的类型?
安装
npm i file-type
示例
const FileType = require('file-type'); (async () => { console.log(await FileType.fromFile('baidu.jp')); //=> {ext: 'png', mime: 'image/png'} })();
参考
【实战】JavaScript 如何检测文件的类型?
暂无评论
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14
2024-06-14