The same as mime-types's contentType method, but with result cached.
npm i cache-content-type
import { getType } from 'cache-content-type';
const contentType = getType('html');
assert.equal(contentType, 'text/html; charset=utf-8');
Made with contributors-img.