New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mimeware

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mimeware

Cross-framework HTTP middleware to infer the proper MIME content type response header

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

mimeware Build Status Dependency Status NPM version

Node.js HTTP server middleware to infer and define the proper MIME content type as response header

It works in multiple web frameworks such as Connect, Express, Restify, Sails... which implements the standard connect-based middleware interface: use(function (req, res, next) { ... })

Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community. Uses node-mime

It was implemented specially for older Express/Connect versions

Installation

npm install mimewire --save

Usage

var express = require('express')
var mimewire = require('mimewire')
var app = express()

app.use(mimewire({ defaultType: 'text/html' }))

app.get('/hello', function (req, res, next) {
  res.send('Hello World!')
})

Options

defaultType

Type: string Type: text/html

Define the default MIME type to use if cannot infer it

ignore

Type: array<string|regex>

An array of regex or string-like path patterns to ignore

charset

Type: boolean Default: true

Define the proper encoding charset if required

License

MIT © Tomas Aparicio

Keywords

FAQs

Package last updated on 27 Jan 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc