type-files

1.0.3 • Public • Published

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'}

Package Sidebar

Install

npm i type-files

Weekly Downloads

75

Version

1.0.3

License

MIT

Unpacked Size

2 kB

Total Files

4

Last publish

Collaborators

  • iwfet