@midhunpm/node-mimetype

1.0.2 • Public • Published

node-mimetype

Find mime type of a file, We are finding the mime type by analyzing the signature bits so it dont have any dependencies, More fast than other libraries,

** We can identify 250+ mime types**

Usage

Install the dependencies.

npm i node-mimetype

const getMimetype = require("node-mimetype");

async getMimetype(filePath, returnPossibleExtensionsList)

Options

option type description
filePath string absolute path to the file
returnPossibleExtensionsList boolean if it's true then it will return the possible extensions list

Example

const getMimetype = require("node-mimetype");

getMimetype(path.resolve('./sample.png'), true).then(res => console.log(res));

/@midhunpm/node-mimetype/

    Package Sidebar

    Install

    npm i @midhunpm/node-mimetype

    Weekly Downloads

    1

    Version

    1.0.2

    License

    ISC

    Unpacked Size

    76.6 kB

    Total Files

    7

    Last publish

    Collaborators

    • midhunpm