Package Exports
- type-files
- type-files/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (type-files) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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'}