New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

friendly-mimes

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

friendly-mimes

Returns you friendly Human readable mime types

latest
Source
npmnpm
Version
3.0.1
Version published
Weekly downloads
1.8K
5.18%
Maintainers
0
Weekly downloads
 
Created
Source

Friendly Mimes

Returns you friendly Human readable mime types

NPM

To Resolve Mime Type

Resolves Mime type (eg: text/csv, application/mp4 etc) of the mime to the specific mime.

import { resolveMime } from 'friendly-mimes'

const item = resolveMime('application/mp4') // { "mime": "application/mp4", "name": "MPEG4", "fileType": ".mp4" }

console.log(item.name) //MPEG4

To Resolve File Type

Resolves File type (.mp4, .mp3 etc) of the mime to the specific mime.

import { resolveFileType } from 'friendly-mimes'

const item = resolveFileType('.csv') // {"mime": "text/csv", "name": "Comma-Separated Values",  "fileType": ".csv" }

console.log(item.mime) // text/csv

To Resolve Name to mime types

Resolves name of the mime to array of related mimes.

import { resolveName } from 'friendly-mimes'

const mimes = resolveName('MPEG-4 Audio') // Array of Mime Types related

console.log(mimes[0].mime)

Contribution

If you see any data that is missing or incorrect, please be free to raise a PR to correct the same.

Keywords

Friendly

FAQs

Package last updated on 28 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts