express-rate-limit

Basic rate-limiting middleware for the Express web server

OTHER License

Downloads
6M
Stars
2.7K
Committers
64

Bot releases are visible (Hide)

express-rate-limit - v6.6.0

Published by github-actions[bot] about 2 years ago

Added

  • Added shutdown method to the Store interface and the MemoryStore. (#322)

You can view the full changelog here.

express-rate-limit - v6.5.2

Published by github-actions[bot] about 2 years ago

Fixed

  • Fixed an issue with missing types in ESM monorepos. (#321)

You can view the changelog here.

express-rate-limit - v6.5.1

Published by github-actions[bot] about 2 years ago

Changed

  • The message option can now be a (sync/asynx) function that returns a value (#311)
  • Updated all dependencies
express-rate-limit - v6.4.0

Published by github-actions[bot] over 2 years ago

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)
express-rate-limit - v6.3.0

Published by github-actions[bot] over 2 years ago

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.
express-rate-limit - v6.2.1

Published by github-actions[bot] over 2 years ago

Fixed

  • Use the default value for an option when undefined is passed to the rate
    limiter.
express-rate-limit - v6.2.0

Published by github-actions[bot] over 2 years ago

Added

  • Export the MemoryStore, so it can now be imported as a named import
    (import { MemoryStore } from 'express-rate-limit').

Fixed

  • Deprecate the onLimitReached option (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.
express-rate-limit - v6.1.0

Published by github-actions[bot] almost 3 years ago

Added

  • Added a named export rateLimit in 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').
express-rate-limit - v6.0.5

Published by github-actions[bot] almost 3 years ago

Fixed

  • Use named imports for ExpressJS types so users do not need to enable the esModuleInterop flag in their Typescript compiler configuration.
express-rate-limit - v6.0.4

Published by github-actions[bot] almost 3 years ago

Fixed

  • Upload the built package as a .tgz to GitHub releases.

Changed

  • Add main and module fields to package.json. This helps tools such as ESLint that do not yet support the exports field.
  • Bumped the minimum node.js version in package-lock.json to match package.json
express-rate-limit - v6.0.3

Published by github-actions[bot] almost 3 years ago

Changed

express-rate-limit - v6.0.2

Published by github-actions[bot] almost 3 years ago

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 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! 🚀
  • Use dts-bundle-generator to generate a single Typescript declaration file.
express-rate-limit - v6.0.1

Published by github-actions[bot] almost 3 years ago

Fixed

  • Ensure CommonJS projects can import the module.
express-rate-limit - v6.0.0

Published by github-actions[bot] almost 3 years ago

Added

  • express 4.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 (.tgz file) on GitHub releases as well as the npm registry.
  • Issue and PR templates.
  • A contributing guide.
  • A changelog.

Changed

  • Rename the draft_polli_ratelimit_headers option to standardHeaders.
  • Rename the headers option to legacyHeaders.
  • Retry-After header is now sent if either legacyHeaders or standardHeaders is set.
  • Allow keyGenerator to be an async function/return a promise.
  • Change the way custom stores are defined.
    • Add the init method for stores to set themselves up using options passed to the middleware.
    • Rename the incr method to increment.
    • Allow the increment, decrement, resetKey and resetAll methods to return a promise.
    • Old stores will automatically be promisified and used.
  • The package can now only be used with NodeJS version 12.9.0 or greater.
  • The onLimitReached configuration option is now deprecated. Replace it with a custom handler that checks the number of hits.

Removed

  • Remove the deprecated limiter.resetIp method (use the limiter.resetKey method instead).
  • Remove the deprecated options delayMs, delayAfter (the delay functionality was moved to the express-slow-down package) and global (use a key generator that returns a constant value).
Package Rankings
Top 0.75% on Npmjs.org
Badges
Extracted from project README
tests npm version npm downloads license
Related Projects