JSPM

cache-content-type

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3125918
  • Score
    100M100P100Q202111F
  • License MIT

Create a full Content-Type header given a MIME type or extension and catch the result

Package Exports

  • cache-content-type

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cache-content-type) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

cache-content-type

The same as mime-types's contentType method, but with result cached.

Install

npm i cache-content-type

Usage

const getType = require('cache-content-type');
const contentType = getType('html');
assert(contentType === 'text/html; charset=utf-8');