ratelimit-header-parser
Version:
Parse RateLimit headers of various forms, including the combined form from draft 7 of the IETF standard, into a normalized format.
127 lines (126 loc) • 3.61 kB
JSON
{
"name": "ratelimit-header-parser",
"version": "0.1.0",
"description": "Parse RateLimit headers of various forms, including the combined form from draft 7 of the IETF standard, into a normalized format.",
"type": "module",
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
}
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/",
"tsconfig.json",
"package.json",
"readme.md",
"license.md",
"changelog.md"
],
"scripts": {
"clean": "del-cli dist/ coverage/ *.log *.tmp *.bak *.tgz",
"build:cjs": "esbuild --platform=node --bundle --target=es2019 --format=cjs --outfile=dist/index.cjs source/index.ts",
"build:esm": "esbuild --platform=node --bundle --target=es2019 --format=esm --outfile=dist/index.mjs source/index.ts",
"build:types": "dts-bundle-generator --out-file=dist/index.d.ts source/index.ts && cp dist/index.d.ts dist/index.d.cts && cp dist/index.d.ts dist/index.d.mts",
"compile": "run-s clean build:*",
"lint:code": "xo",
"lint:rest": "prettier --ignore-unknown --check .",
"lint": "run-s lint:*",
"format:code": "npm run lint:code -- --fix",
"format:rest": "npm run lint:rest -- --write .",
"format": "run-s format:*",
"test:lib": "jest",
"test": "run-s lint test:lib",
"pre-commit": "lint-staged",
"prepare": "run-s compile && husky install config/husky"
},
"repository": {
"type": "git",
"url": "git+https://github.com/express-rate-limit/ratelimit-header-parser.git"
},
"keywords": [
"ratelimit",
"x-ratelimit-limit",
"headers",
"parser",
"express-rate-limit",
"ratelimit-policy"
],
"author": "Nathan Friedly <https://www.nfriedly.com/>",
"license": "MIT",
"bugs": {
"url": "https://github.com/express-rate-limit/ratelimit-header-parser/issues"
},
"homepage": "https://github.com/express-rate-limit/ratelimit-header-parser#readme",
"devDependencies": {
"@express-rate-limit/prettier": "^1.0.0",
"@express-rate-limit/tsconfig": "^1.0.0",
"@jest/globals": "^29.6.3",
"@jest/types": "^29.6.3",
"@types/node": "^20.5.1",
"del-cli": "^5.0.0",
"dts-bundle-generator": "^8.0.1",
"esbuild": "^0.19.2",
"husky": "^8.0.3",
"jest": "^29.6.3",
"lint-staged": "^14.0.1",
"npm-run-all": "^4.1.5",
"ts-jest": "^29.1.1",
"typescript": "^5.1.6",
"xo": "^0.56.0"
},
"jest": {
"preset": "ts-jest/presets/default-esm",
"collectCoverage": true,
"collectCoverageFrom": [
"source/**/*.ts"
],
"testTimeout": 30000,
"testMatch": [
"**/test/*-test.ts"
],
"moduleFileExtensions": [
"js",
"jsx",
"json",
"ts",
"tsx"
],
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.js$": "$1"
}
},
"xo": {
"prettier": true,
"rules": {
"@typescript-eslint/consistent-indexed-object-style": [
"error",
"index-signature"
],
"n/no-unsupported-features/es-syntax": 0
},
"overrides": [
{
"files": "test/*.ts",
"rules": {
"@typescript-eslint/no-unsafe-argument": 0
}
}
],
"ignores": ["examples/"]
},
"prettier": "@express-rate-limit/prettier",
"lint-staged": {
"{source,test}/**/*.ts": "xo --fix",
"**/*.{json,yaml,md}": "prettier --ignore-unknown --write "
}
}