Skip to content
Detect file type with mmmagic and mime.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
source
test
.editorconfig
.gitattribuets
.gitignore
LICENSE
README.md
package-lock.json
package.json
tsconfig.json
tslint.json

README.md

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: '' }
})
You can’t perform that action at this time.