7.3 KiB
Executable File
7.3 KiB
Executable File
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
6.7.0
Changed
- Updated links to point to new express-rate-limit organization on GitHub.
- Added advertisement to Readme for project sponsor Zuplo.
- Updated TypeScript version and other dev dependencies
- Changed CI test suite: dropped node.js 12, added node.js 19
No functional changes.
6.6.0
Added
- Added
shutdownmethod to the Store interface and the MemoryStore.
6.5.2
Fixed
- Fixed an issue with missing types in ESM monorepos.
6.5.1
Added
- The message option can now be a (sync/asynx) function that returns a value (#311)
Changed
- Updated all dependencies
Note: 6.5.0 was not released due to CI automation issues.
6.4.0
Added
- Adds Express 5 (
5.0.0-beta.1) as a supported peer dependency (#304)
Changed
- Tests are now run on Node 12, 14, 16 and 18 on CI (#305)
- Updated all development dependencies (#306)
6.3.0
Changed
- Changes the build target to es2019 so that ESBuild outputs code that can run with Node 12.
- Changes the minimum required Node version to 12.9.0.
6.2.1
Fixed
- Use the default value for an option when
undefinedis passed to the rate limiter.
6.2.0
Added
- Export the
MemoryStore, so it can now be imported as a named import (import { MemoryStore } from 'express-rate-limit').
Fixed
- Deprecate the
onLimitReachedoption (this was supposed to be deprecated in v6.0.0 itself); developers should use a custom handler function that checks if the rate limit has been exceeded instead.
6.1.0
Added
- Added a named export
rateLimitin case the default import does not work.
Fixed
- Added a named export
default, so Typescript CommonJS developers can default-import the library (import rateLimit from 'express-rate-limit').
6.0.5
Fixed
- Use named imports for ExpressJS types so users do not need to enable the
esModuleInteropflag in their Typescript compiler configuration.
6.0.4
Fixed
- Upload the built package as a
.tgzto GitHub releases.
Changed
- Add
mainandmodulefields topackage.json. This helps tools such as ESLint that do not yet support theexportsfield. - Bumped the minimum node.js version in
package-lock.jsonto matchpackage.json
6.0.3
Changed
- Bumped minimum Node version from 12.9 to 14.5 in
package.jsonbecause the transpiled output uses the nullish coalescing operator (??), which isn't supported in node.js prior to 14.x.
6.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-esmenvironments. - usage of the library with external stores (
redis,mongo,memcached,precise).
- importing the library in
Changed
- Use
esbuildto generate ESM and CJS output. This reduces the size of the built package from 138 kb to 13kb and build time to 4 ms! 🚀 - Use
dts-bundle-generatorto generate a single Typescript declaration file.
6.0.1
Fixed
- Ensure CommonJS projects can import the module.
6.0.0
Added
express4.x as a peer dependency.- Better Typescript support (the library was rewritten in Typescript).
- Export the package as both ESM and CJS.
- Publish the built package (
.tgzfile) on GitHub releases as well as the npm registry. - Issue and PR templates.
- A contributing guide.
Changed
- Rename the
draft_polli_ratelimit_headersoption tostandardHeaders. - Rename the
headersoption tolegacyHeaders. Retry-Afterheader is now sent if eitherlegacyHeadersorstandardHeadersis set.- Allow
keyGeneratorto be an async function/return a promise. - Change the way custom stores are defined.
- Add the
initmethod for stores to set themselves up using options passed to the middleware. - Rename the
incrmethod toincrement. - Allow the
increment,decrement,resetKeyandresetAllmethods to return a promise. - Old stores will automatically be promisified and used.
- Add the
- The package can now only be used with NodeJS version 12.9.0 or greater.
- The
onLimitReachedconfiguration option is now deprecated. Replace it with a customhandlerthat checks the number of hits.
Removed
- Remove the deprecated
limiter.resetIpmethod (use thelimiter.resetKeymethod instead). - Remove the deprecated options
delayMs,delayAfter(the delay functionality was moved to theexpress-slow-downpackage) andglobal(use a key generator that returns a constant value).
5.x
Added
- The middleware ~throws~ logs an error if
request.ipis undefined.
Removed
- Removes typescript typings. (See #138)
4.x
Changed
- The library no longer modifies the passed-in options object, it instead makes a clone of it.
3.x
Added
- Simplifies the default
handlerfunction so that it no longer changes the response format. The default handler also uses response.send.
Changes
onLimitReachednow only triggers once for a client and window. However, thehandlemethod is called for every blocked request.
Removed
- The
delayAfteranddelayMsoptions; they were moved to the express-slow-down package.
2.x
Added
- A
limiter.resetKey()method to reset the hit counter for a particular client
Changes
- The rate limiter now uses a less precise but less resource intensive method of tracking hits from a client.
Removed
- The
globaloption.