Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mimer

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mimer

A simple Mime type getter

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
42K
decreased by-78.36%
Maintainers
1
Weekly downloads
 
Created

What is mimer?

The 'mimer' npm package is a utility for determining the MIME type of a file based on its extension. It is useful for applications that need to handle files and their types, such as web servers, file upload handlers, and content management systems.

What are mimer's main functionalities?

Determine MIME type from file extension

This feature allows you to get the MIME type of a file by providing its filename or extension. In this example, 'example.txt' returns 'text/plain'.

const mimer = require('mimer');
const mimeType = mimer('example.txt');
console.log(mimeType); // Output: 'text/plain'

Default MIME type for unknown extensions

If the file extension is not recognized, 'mimer' returns a default MIME type, which is 'application/octet-stream' in this case.

const mimer = require('mimer');
const mimeType = mimer('example.unknown');
console.log(mimeType); // Output: 'application/octet-stream'

Other packages similar to mimer

Keywords

FAQs

Package last updated on 25 Jan 2014

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc