Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@types/mime
Advanced tools
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.
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'"
The mime-types package is similar to mime in that it provides lookup functionality for MIME types and file extensions. It is a lighter version without the code for MIME type definition and is based on the mime-db dataset.
The mime-db package is a comprehensive dataset of MIME type information, which other packages can use to build their MIME type functionality. It is not a direct utility like mime, but it serves as the source of MIME type information for other packages.
npm install --save @types/mime
This package contains type definitions for mime (https://github.com/broofa/node-mime).
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/mime
Additional Details
These definitions were written by Jeff Goddard https://github.com/jedigo.
FAQs
Stub TypeScript definitions entry for mime, which provides its own types definitions
The npm package @types/mime receives a total of 21,383,684 weekly downloads. As such, @types/mime popularity was classified as popular.
We found that @types/mime demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.