cache-content-type
Advanced tools
Comparing version 1.0.1 to 2.0.0
{ | ||
"name": "cache-content-type", | ||
"version": "1.0.1", | ||
"description": "Create a full Content-Type header given a MIME type or extension and catch the result", | ||
"main": "index.js", | ||
"files": [ | ||
"index.js" | ||
], | ||
"version": "2.0.0", | ||
"engines": { | ||
"node": ">= 18.0.0" | ||
}, | ||
"description": "Create a full Content-Type header given a MIME type or extension and cache the result", | ||
"scripts": { | ||
"test": "egg-bin test", | ||
"cov": "egg-bin cov", | ||
"ci": "eslint . && npm run cov" | ||
"test": "npm run lint -- --fix && egg-bin test", | ||
"ci": "npm run lint && egg-bin cov && npm run prepublishOnly", | ||
"lint": "eslint src test", | ||
"prepublishOnly": "tshy && tshy-after" | ||
}, | ||
"dependencies": { | ||
"mime-types": "^2.1.18", | ||
"ylru": "^1.2.0" | ||
"mime-types": "^2.1.35", | ||
"ylru": "^1.4.0" | ||
}, | ||
"devDependencies": { | ||
"egg-bin": "^4.7.1", | ||
"egg-ci": "^1.8.0", | ||
"eslint": "^5.1.0", | ||
"eslint-config-egg": "^7.0.0", | ||
"mm": "^2.2.0" | ||
"@eggjs/tsconfig": "^1.3.3", | ||
"@types/mime-types": "^2.1.4", | ||
"@types/mocha": "^10.0.1", | ||
"@types/node": "^20.2.5", | ||
"egg-bin": "6", | ||
"eslint": "8", | ||
"eslint-config-egg": "13", | ||
"mm": "3", | ||
"tshy": "^1.15.1", | ||
"tshy-after": "^1.0.0", | ||
"typescript": "^5.4.5" | ||
}, | ||
@@ -34,10 +40,32 @@ "repository": { | ||
], | ||
"engines": { | ||
"node": ">= 6.0.0" | ||
"author": "dead_horse", | ||
"license": "MIT", | ||
"type": "module", | ||
"tshy": { | ||
"exports": { | ||
"./package.json": "./package.json", | ||
".": "./src/index.ts" | ||
} | ||
}, | ||
"ci": { | ||
"version": "6, 8, 10" | ||
"exports": { | ||
"./package.json": "./package.json", | ||
".": { | ||
"import": { | ||
"source": "./src/index.ts", | ||
"types": "./dist/esm/index.d.ts", | ||
"default": "./dist/esm/index.js" | ||
}, | ||
"require": { | ||
"source": "./src/index.ts", | ||
"types": "./dist/commonjs/index.d.ts", | ||
"default": "./dist/commonjs/index.js" | ||
} | ||
} | ||
}, | ||
"author": "dead_horse", | ||
"license": "MIT" | ||
"files": [ | ||
"dist", | ||
"src" | ||
], | ||
"main": "./dist/commonjs/index.js", | ||
"types": "./dist/commonjs/index.d.ts" | ||
} |
@@ -1,6 +0,21 @@ | ||
## cache-content-type | ||
# cache-content-type | ||
[![NPM version][npm-image]][npm-url] | ||
[![Node.js CI](https://github.com/node-modules/cache-content-type/actions/workflows/nodejs.yml/badge.svg)](https://github.com/node-modules/cache-content-type/actions/workflows/nodejs.yml) | ||
[![Test coverage][codecov-image]][codecov-url] | ||
[![Known Vulnerabilities][snyk-image]][snyk-url] | ||
[![npm download][download-image]][download-url] | ||
[npm-image]: https://img.shields.io/npm/v/cache-content-type.svg?style=flat-square | ||
[npm-url]: https://npmjs.org/package/cache-content-type | ||
[codecov-image]: https://codecov.io/github/node-modules/cache-content-type/coverage.svg?branch=master | ||
[codecov-url]: https://codecov.io/github/node-modules/cache-content-type?branch=master | ||
[snyk-image]: https://snyk.io/test/npm/cache-content-type/badge.svg?style=flat-square | ||
[snyk-url]: https://snyk.io/test/npm/cache-content-type | ||
[download-image]: https://img.shields.io/npm/dm/cache-content-type.svg?style=flat-square | ||
[download-url]: https://npmjs.org/package/cache-content-type | ||
The same as [mime-types](https://github.com/jshttp/mime-types)'s contentType method, but with result cached. | ||
### Install | ||
## Install | ||
@@ -11,8 +26,9 @@ ```bash | ||
### Usage | ||
## Usage | ||
```js | ||
const getType = require('cache-content-type'); | ||
```ts | ||
import { getType } from 'cache-content-type'; | ||
const contentType = getType('html'); | ||
assert(contentType === 'text/html; charset=utf-8'); | ||
assert.equal(contentType, 'text/html; charset=utf-8'); | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6348
9
56
34
Yes
11
1
Updatedmime-types@^2.1.35
Updatedylru@^1.4.0