An open API service indexing awesome lists of open source software.

https://github.com/shimohq/node-mmmagic-type

Detect file type with mmmagic and mime.
https://github.com/shimohq/node-mmmagic-type

Last synced: 6 months ago
JSON representation

Detect file type with mmmagic and mime.

Awesome Lists containing this project

README

          

# mmmagic-type

Detect file type with [mmmagic](https://github.com/mscdex/mmmagic) and [mime](https://github.com/broofa/node-mime).

# Install

```
npm i mmmagic-type
```

# Usage

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

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