get-file-mime-type
v1.0.0
Published
Get or check a file mime type
Readme
File Mime Type
Get or check a file mime Type
Features
Install
With npm:
npm install get-file-mime-typeUsage
// Import the package
import { getFileMimeType } from 'get-file-mime-type';
// Get the mime type from a given fileº
getNodePackagesInstalledVersion(filename);API
getFileMimeType(filename)
filename
Type: string
This is the the route to the file that we want to get the mime type
Then, it will returns:
type FileMimeType = {
mimetype: string; // File mime type
signature: string; // File signature
safeCheck: boolean; // Wheter the file has been checked using Magic Numbers - If the file does not have Magic Numbers 'safeCheck' will be 'false'
};