The same as mime-types's contentType method, but with result cached.
npm i cache-content-typeimport { getType } from 'cache-content-type';
const contentType = getType('html');
assert.equal(contentType, 'text/html; charset=utf-8');Create a full Content-Type header given a MIME type or extension and cache the result
TypeScriptMIT
The same as mime-types's contentType method, but with result cached.
npm i cache-content-typeimport { getType } from 'cache-content-type';
const contentType = getType('html');
assert.equal(contentType, 'text/html; charset=utf-8');