Socket
Socket
Sign inDemoInstall

@types/mime

Package Overview
Dependencies
1
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/mime

Stub TypeScript definitions entry for mime, which provides its own types definitions


Version published
Weekly downloads
26M
increased by0.18%
Maintainers
1
Install size
93.1 kB
Created
Weekly downloads
 

Package description

What is @types/mime?

The @types/mime package contains TypeScript type definitions for the 'mime' package, which is a utility to work with MIME types. It allows TypeScript developers to use the 'mime' package with type safety, providing autocompletion and type checking during development.

What are @types/mime's main functionalities?

Lookup MIME type for a file extension

This feature allows you to get the MIME type for a given file extension. The getType function takes a file extension as a string and returns the corresponding MIME type.

"import mime from 'mime';

const mimeType = mime.getType('json'); // 'application/json'"

Get file extension for a MIME type

This feature allows you to get the file extension associated with a given MIME type. The getExtension function takes a MIME type as a string and returns the corresponding file extension.

"import mime from 'mime';

const extension = mime.getExtension('application/json'); // 'json'"

Other packages similar to @types/mime

Readme

Source

This is a stub types definition for @types/mime (https://github.com/broofa/mime#readme).

mime provides its own type definitions, so you don't need @types/mime installed!

FAQs

Last updated on 31 Mar 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc