Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

express-rate-limit

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-rate-limit - npm Package Compare versions

Comparing version 6.0.1 to 6.0.2

dist/index.cjs

28

changelog.md

@@ -9,2 +9,30 @@ # Changelog

## [6.0.2](https://github.com/nfriedly/express-rate-limit/releases/v6.0.2)
### Fixed
- Ensure CommonJS projects can import the module.
### Added
- Add additional tests that test:
- importing the library in `js-cjs`, `js-esm`, `ts-cjs`, `ts-esm`
environments.
- usage of the library with external stores (`redis`, `mongo`, `memcached`,
`precise`).
### Changed
- Use [`esbuild`](https://esbuild.github.io/) to generate ESM and CJS output.
This reduces the size of the built package from 138 kb to 13kb and build time
to 4 ms! :rocket:
- Use [`dts-bundle-generator`](https://github.com/timocov/dts-bundle-generator)
to generate a single Typescript declaration file.
## [6.0.1](https://github.com/nfriedly/express-rate-limit/releases/v6.0.1)
### Fixed
- Ensure CommonJS projects can import the module.
## [6.0.0](https://github.com/nfriedly/express-rate-limit/releases/v6.0.0)

@@ -11,0 +39,0 @@

41

package.json
{
"name": "express-rate-limit",
"version": "6.0.1",
"version": "6.0.2",
"description": "Basic IP rate-limiting middleware for Express. Use to limit repeated requests to public APIs and/or endpoints such as password reset.",

@@ -31,7 +31,7 @@ "author": {

"type": "module",
"types": "./dist/esm/index.d.ts",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}

@@ -52,13 +52,17 @@ },

"clean": "del-cli dist/ coverage/ *.log *.tmp *.bak *.tgz",
"build:cjs": "tsc --project config/typescript/cjs.json && cpy --rename package.json config/node/cjs.json dist/cjs/",
"build:esm": "tsc --project config/typescript/esm.json && cpy --rename package.json config/node/esm.json dist/esm/",
"build": "run-p build:*",
"compile": "run-s clean build",
"lint": "xo",
"autofix": "xo --fix",
"test-lib": "cross-env TS_NODE_PROJECT=config/typescript/test.json NODE_OPTIONS=--experimental-vm-modules jest",
"test": "run-s compile lint test-lib",
"view-coverage": "npx serve coverage/lcov-report",
"build:cjs": "esbuild source/index.ts --bundle --format=cjs --outfile=dist/index.cjs --footer:js='module.exports = rateLimit;'",
"build:esm": "esbuild source/index.ts --bundle --format=esm --outfile=dist/index.mjs",
"build:types": "dts-bundle-generator --out-file=dist/index.d.ts source/index.ts",
"compile": "run-s clean build:*",
"lint:code": "xo --ignore test/external/",
"lint:rest": "prettier --ignore-path .gitignore --ignore-unknown --check .",
"lint": "run-s lint:*",
"autofix:code": "xo --ignore test/external/ --fix",
"autofix:rest": "prettier --ignore-path .gitignore --ignore-unknown --write .",
"autofix": "run-s autofix:*",
"test:lib": "cross-env NODE_OPTIONS=--experimental-vm-modules jest",
"test:ext": "cd test/external/ && bash run-all-tests",
"test": "npm pack && run-s lint test:*",
"pre-commit": "lint-staged",
"prepare": "npm run compile && husky install config/husky"
"prepare": "run-s compile && husky install config/husky"
},

@@ -74,5 +78,6 @@ "peerDependencies": {

"@types/supertest": "^2.0.11",
"cpy-cli": "^3.1.1",
"cross-env": "^7.0.3",
"del-cli": "^4.0.1",
"dts-bundle-generator": "^6.2.0",
"esbuild": "^0.14.8",
"express": "^4.17.1",

@@ -125,3 +130,3 @@ "husky": "^7.0.4",

"testMatch": [
"**/test/**/*-test.[jt]s?(x)"
"**/test/library/**/*-test.[jt]s?(x)"
],

@@ -140,5 +145,5 @@ "moduleFileExtensions": [

"lint-staged": {
"{source,test}/**/*.ts": "xo --fix",
"**/*.{json,yaml,md}": "prettier --write"
"{source,test}/**/*.ts": "xo --ignore test/external/ --fix",
"**/*.{json,yaml,md}": "prettier --ignore-path .gitignore --ignore-unknown --write "
}
}

@@ -17,5 +17,5 @@ # <div align="center"> Express Rate Limit </div>

> This module does not share state with other processes/servers by
> default. If you need a more robust solution, I recommend using an external
> store. See the [`stores` section](#store) below for a list of external stores.
> This module does not share state with other processes/servers by default. If
> you need a more robust solution, I recommend using an external store. See the
> [`stores` section](#store) below for a list of external stores.

@@ -279,5 +279,5 @@ This module was designed to only handle the basics and didn't even support

`request` and the `response` objects. The `next` param is available if you need
to pass to the next middleware/route. Finally, the `options` param has all
of the options that originally passed in when creating the current limiter and
the default values for other options.
to pass to the next middleware/route. Finally, the `options` param has all of
the options that originally passed in when creating the current limiter and the
default values for other options.

@@ -284,0 +284,0 @@ The `request.rateLimit` object has `limit`, `current`, and `remaining` number of

{
"compilerOptions": {
"declaration": true,
"sourceMap": true,

@@ -12,5 +11,3 @@ "strict": true,

"moduleResolution": "node",
"esModuleInterop": true,
"inlineSources": true
"esModuleInterop": true
},

@@ -17,0 +14,0 @@ "include": ["./source/**/*.ts"],

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc