Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 356 Bytes

README.md

File metadata and controls

21 lines (15 loc) · 356 Bytes

mmmagic-type

Detect file type with mmmagic and mime.

Install

npm i mmmagic-type

Usage

import fs from 'fs'
import { detect } from 'mmmagic-type'

detect(fs.readFileSync('/path/to/file')).then(type => {
  console.log(type)
  // { ext: '', mime: '' }
})