Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
simple-mime
Advanced tools
Readme
This is a small, simple mime database. A common thing for node servers to do is serve static files over HTTP. This requires, among other things, knowin the mime type you want to send. Here is a simple module to make this easy.
If you use NPM, then install this via npm. Also, please remember to put it as a dependency in your package.json file of your module that requires it.
npm install simple-mime
If you choose to not use npm, or can't use it in your environment, then simply copy the single file simple-mime.js
to somewhere you can require it.
Simply load this library, configure your fallback mime type, and query it for the mime type of various filenames.
var getMimeType = require('mime')('application/octect-stream');
var file = "/bar/foo/baz.mp3";
var type = getMimeType(file);
You will probably not use this except as a dependency to your own module that deals with serving files over HTTP, or some other protocol that requires mime types.
This doesn't have as many features as the mime
module in npm, but it's a lot simpler too. The goal is that it's useful to someone.
FAQs
A simple mime database.
The npm package simple-mime receives a total of 15,526 weekly downloads. As such, simple-mime popularity was classified as popular.
We found that simple-mime demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.