miming 3

Processing and formatting for various mime types.


Written in JavaScript by 1 contributor


Need Support?

we offer maintenance, support and development services for all our open source projects.

Contact Us


Build Status

A very small library for parsing and formatting various different mime types in node.js.

Note: Miming does not deal with content negotiation, you should use another library such as negotiator for that.

Miming supports the following built in mime types:


Via npm:

npm install miming


Creating a collection

Create a Collection of MimeTypes that you'd like to handle in your application. Specify the types in order of precedence.

var Miming = require('miming');

var collection = new Miming.Collection([

var mime = collection.get('application/json');

console.log(mime.format({foo: 'bar'})).should.equal('{"foo":"bar"}');

Adding a type to a collection

// or
// or
collection.add(new Miming.Types.JSONLD());
// or

Processing requests

Here's a tiny application which parses requests in various formats, translates them to JSON, and echos them back to the client.

var http = require('http'),
    Negotiator = require('negotiator'),
    Miming = require('../lib'),
    collection = new Miming.Collection();


http.createServer(function (req, res) {
  if (!req.headers['content-type']) {
    res.writeHead(200, {'Content-Type': 'text/html'});
    res.end('<form method="POST"><textarea name="content"></textarea><br><button type="submit">Go</button></form>');
  .spread(function (body, files) {
    res.writeHead(200, {'Content-Type': 'application/json'});
    return collection.format('application/json', {
      body: body,
      files: files
}).listen(1337, '');
console.log('Server running at');


MIT, see LICENSE.md.

44 other JavaScript projects

fast.jsJavaScript 2930

Faster user-land reimplementations for several common builtin native JavaScript functions.

babel-plugin-typecheckJavaScript 823

Static and runtime type checking for JavaScript in the form of a Babel plugin.

babel-plugin-closure-eliminationJavaScript 223

A Babel plugin which eliminates closures from your JavaScript wherever possible.

orientoJavaScript 212

Former official node.js driver for OrientDB. Fast, lightweight, uses the binary protocol. Now deprecated.

babel-plugin-macrosJavaScript 184

Hygienic, non-syntactic macros for JavaScript via a Babel plugin.

htmlingJavaScript 167

Polymer / HTML5 templating syntax for node.js

babel-plugin-contractsJavaScript 128

Design by Contract for JavaScript via a Babel plugin.

YiiBlocksJavaScript 70

A set of building blocks that provide common functions for Yii web applications

contractualJavaScript 52

Unobtrusive, backwards compatible, syntactic sugar for Design by contract in JavaScript.

gitignore-parserJavaScript 34

A simple .gitignore parser for node.js

modelingJavaScript 14

Fast and flexible data models for node.js and the browser.

binary-protocolJavaScript 13

Easy, fast, writers and readers for implementing custom binary protocols in node.js.

YiiJSJavaScript 11

A port of the Yii PHP framework to JavaScript

url-routeJavaScript 10

Web component providing URL routing

validatingJavaScript 10

Quick and easy validators for node.js and the browser.

babel-plugin-traceJavaScript 6

This is a Babel plugin which adds a straightforward, declarative syntax for adding debug logging to JavaScript applications.

mallocJavaScript 6

Simple malloc() & free() implementation for node.js, built on top of array buffers.

geonames-importerJavaScript 6

Imports geonames data into elasticsearch

dispatchingJavaScript 5

Tiny routing / dispatch library for node and the browser.

atomicbuffersJavaScript 5

Atomic `readInt32()`, `writeInt32()`, `readUInt32()` and `writeUInt32()` for node.js buffers.

castingJavaScript 5

Tiny type casting library for node.js and the browser.

classingJavaScript 5

Fluent classes for node.js and the browser.

oriento-query-builderJavaScript 1

A standalone query builder for OrientDB, designed for node.js/io.js and the browser.

bootstrap-tooltipJavaScript 1

Twitter Bootstrap Tooltip plugin packaged for component.js instead of bower

bootstrap-transitionJavaScript 1

Twitter Bootstrap Transition plugin packaged for component.js instead of bower

obligationsJavaScript 1

Tiny JavaScript library for preconditions and postconditions, intended for use with Contractual.


Twitter Bootstrap Button plugin packaged for component.js instead of bower


Twitter Bootstrap Scrollspy plugin packaged for component.js instead of bower


Twitter Bootstrap Typeahead plugin packaged for component.js instead of bower


Twitter Bootstrap Modal plugin packaged for component.js instead of bower


Twitter Bootstrap Dropdown plugin packaged for component.js instead of bower


Twitter Bootstrap Carousel plugin packaged for component.js instead of bower


Twitter Bootstrap Tab plugin packaged for component.js instead of bower


A basic Flex App setup for video broadcasting


WebRTC sample code. For testing purposes only.


Twitter Bootstrap Popover plugin packaged for component.js instead of bower


Twitter Bootstrap Alert plugin packaged for component.js instead of bower


Twitter Bootstrap Affix plugin packaged for component.js instead of bower


JQuery plugin for covering/uncovering DOM elements


A Sample CRUD application structured by Backbone js and backed by a node restfull api.


Twitter Bootstrap packaged for component.js instead of bower


Twitter Bootstrap Collapse plugin packaged for component.js instead of bower




A popular romanian card game