Node.js/wasm binding for https://github.com/mmalecot/file-format
https://github.com/toeverything/file-type.git
@toeverything/file-typeimport { readFile } from 'node:fs'
import { FileType } from '@toeverything/file-type'
const fileType = new FileType(await readFile('path/to/file.jpg'))
console.log(fileType.mime()) // 'application/image/jpeg'
console.log(fileType.ext()) // 'jpg'
โโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโ
โ (index) โ Task Name โ ops/sec โ Average Time (ns) โ Margin โ Samples โ
โโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโโค
โ 0 โ '@toeverything/file-type' โ '1,554,666' โ 643.2246344556239 โ 'ยฑ2.01%' โ 777334 โ
โ 1 โ 'file-type' โ '664,314' โ 1505.3104426207442 โ 'ยฑ0.38%' โ 332158 โ
โโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโ