Socket
Socket
Sign inDemoInstall

@types/mime

Package Overview
Dependencies
0
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/mime

TypeScript definitions for mime


Version published
Weekly downloads
21M
decreased by-19.39%
Maintainers
1
Install size
3.48 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

Installation

npm install --save @types/mime

Summary

This package contains type definitions for mime (https://github.com/broofa/node-mime).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mime.

Additional Details

  • Last updated: Thu, 04 Aug 2022 21:02:19 GMT
  • Dependencies: none
  • Global values: mime, mimelite

Credits

These definitions were written by Jeff Goddard, and Daniel Hritzkiv.

FAQs

Last updated on 04 Aug 2022

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