Socket
Socket
Sign inDemoInstall

simple-mime

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    simple-mime

A simple mime database.


Version published
Weekly downloads
20K
decreased by-21.97%
Maintainers
1
Install size
8.91 kB
Created
Weekly downloads
 

Readme

Source

Mime

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.

Install

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.

Usage

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);

Goal

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

Last updated on 25 Jul 2014

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