mirror of
https://github.com/danbulant/koa-plugins
synced 2026-05-19 04:08:43 +00:00
| .. | ||
| History.md | ||
| index.js | ||
| package.json | ||
| README.md | ||
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');