
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@locustjs/mime
Advanced tools
This utility library provides a handy Mime object that helps in finding mime of a file extension.
NPM
npm i @locustjs/cache
Example:
import Mime from '@locustjs/mime'
console.log(Mime.getMimeType('.jpg')); // "image/jpeg"
console.log(Mime.getMimeType('.json')); // "application/json"
console.log(Mime.getExtension("myphoto.jpg")); // ".jpg"
console.log(Mime.getExtensions("image/jpeg")); // ["jpeg", "jpg", "jpe"]
console.log(Mime.getFullMime('.json'));
/*
{
charSet: "UTF-8",
compressible: true,
extensions: "json, map",
id: 137,
source: "iana",
value: "application/json",
}
*/
MimeProviderBase: base abstract class of mime providersMimeProviderDefault: default implementation of MimeProviderBase.MimeTypes: returns list of all mime types.Mimes: returns list of all mimes.getExtension (filenameOrExtension): returns extension of a file (withought dot character).getFullMime (filenameOrExtension): returns full mime inforation for the given filename/extension.getMimeType (filenameOrExtension): returns mime type of the given filename/extension.getExtensions(mime): returns file extension of the given mime.Using setMimeProvider() function we can change mime provider object in Mime variable.
import Mime, { MimeProviderBase, setMimeProvider} from '@locustjs/mime'
class MyMimeProvider extends MimeProviderBase {
...
}
setMimeProvider(new MyMimeProvider())
console.log(Mime.getMimeType('.jpg'))
FAQs
This library provides classes and a helper to work with MIME.
We found that @locustjs/mime demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.