node package manager
Don’t reinvent the wheel. Reuse code within your team. Create a free org »

set-type

DEPRECATED - Please use mime-types instead.

Set Type

Return a well-formatted content type header given an extension.

var set = require('set-type')
 
app.use(function (req, res) {
  res.setHeader('Content-Type', set('html'))
  // => text/html; charset=utf-8 
})