Détail du package

cache-content-type

node-modules13.6mMIT2.1.0

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

mime, content-type, lru

readme

cache-content-type

NPM version Node.js CI Test coverage Known Vulnerabilities npm download Node.js Version PRs Welcome CodeRabbit Pull Request Reviews

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

Install

npm i cache-content-type

Usage

import { getType } from 'cache-content-type';

const contentType = getType('html');
assert.equal(contentType, 'text/html; charset=utf-8');

License

MIT

Contributors

Contributors

Made with contributors-img.

changelog

Changelog

2.1.0 (2025-03-11)

Features

2.0.0 (2024-06-08)

⚠ BREAKING CHANGES

  • drop Node.js < 18 support

https://github.com/eggjs/egg/issues/5257

Summary by CodeRabbit

  • New Features
    • Introduced Node.js CI workflow for automated testing and releases.
  • Added TypeScript support and enforced node prefix rules in ESLint configuration.

  • Documentation

  • Updated README with new badges and revised installation/usage instructions.

  • Chores

    • Updated .gitignore to include dist directory and .tshy* files.
    • Updated package.json with new dependencies, scripts, and metadata.
  • Tests

    • Added tests for caching content types functionality.

Features

1.0.1 / 2018-07-18

others

1.0.0 / 2018-07-11

features

  • [ecb6476] - feat: cache result of mimeTypes.contentType (dead-horse <dead_horse@qq.com>),fatal: No names found, cannot describe anything.

others