type-files
v1.0.3
Published
> Detect the file type of a base64 The file type is detected by checking the [magic number] of the base64.
Downloads
545
Maintainers
Readme
type-files
Detect the file type of a base64 The file type is detected by checking the [magic number] of the base64.
This package is for detecting bas64 based file formats, not binary based formats.
Install
npm install type-files
Usage
Node.js
Determine file type from a file:
import {detectMimeType} from 'type-files';
console.log(detectMimeType('iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB'));
//=> {ext: 'png', mime: 'image/png'}