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.
- Host: GitHub
- URL: https://github.com/shimohq/node-mmmagic-type
- Owner: shimohq
- License: mit
- Created: 2019-04-11T11:49:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-11T11:51:05.000Z (over 6 years ago)
- Last Synced: 2025-02-15T07:47:14.455Z (8 months ago)
- Language: TypeScript
- Size: 221 KB
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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: '' }
})
```