Socket
Socket
Sign inDemoInstall

@nestjs/throttler

Package Overview
Dependencies
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nestjs/throttler - npm Package Versions

23

6.2.1

Diff

Changelog

Source

6.2.1

Patch Changes

  • fbf27c6: Add the guard interfaces for export for public use
nestjscore
published 6.2.0 •

Changelog

Source

6.2.0

Minor Changes

  • 3d1a9a5: Swap MD5 hash for SHA256 to better support OpenSSL 3.0 and future iterations
nestjscore
published 6.1.1 •

Changelog

Source

6.1.1

Patch Changes

  • ef69348: Update the readme for websockets
nestjscore
published 6.1.0 •

Changelog

Source

6.1.0

Minor Changes

  • e058d50: Use ceil instead of floor while calculating expire and block expire at to properly account for rounding up instead of down and accidentally allowing for early continued requests. Related to #2074
nestjscore
published 6.0.0 •

Changelog

Source

6.0.0

Major Changes

  • 93b62d2: A time will be provided to block the request separately from the ttl. There is a breaking change at the library level. Storage library owners will be affected by this breaking change
  • 9b3f9cd: - e17a5dc: The storage has been updated to utilize Map instead of a simple object for key-value storage. This enhancement offers improved performance, especially for scenarios involving frequent additions and deletions of keys. There is a breaking change at the library level. Storage library owners will be affected by this breaking change
nestjscore
published 5.2.0 •

Changelog

Source

5.2.0

Minor Changes

  • 16467c1: Add dynamic error messages based on context and ThrottlerLimitDetail
nestjscore
published 5.1.2 •

Changelog

Source

5.1.2

Patch Changes

  • 7a431e5: Improve performance by replacing md5 npm package with Node.js crypto module.
nestjscore
published 5.1.1 •

Changelog

Source

5.1.1

Patch Changes

  • b06a208: Resolves a bug that cause 'this' to be undefined in the 'getTracker' and 'generateKey' methods of the custom ThrottlerGuard
nestjscore
published 5.1.0 •

Changelog

Source

5.1.0

Minor Changes

  • 903d187: Allow for throttler definitions to define their own trackers and key generators to allow for more customization of the rate limit process
nestjscore
published 5.0.1 •

Changelog

Source

5.0.1

Patch Changes

  • bc9e6b2: Correctly assign metadata for multiple throttlers passed to @SkipThrottle()

Major Changes

  • 2f4f2a7: # FEATURES

    • allow for multiple Throttler Contexts
    • allow for conditionally skipping based on ThrottleGuard#shouldSkip method
    • allow for easily overriding throttler message based on guard method
    • extra context passed to throw method for better customization of message
    • ThrottlerStorage no longer needs a storage property`
    • getTracker can now be async

    BREAKING CHANGES

    • ttl is now in milliseconds, not seconds, but there are time helper exposed to ease the migration to that
    • the module options is now either an array or an object with a throttlers array property
    • @Throttle() now takes in an object instead of two parameters, to allow for setting multiple throttle contexts at once in a more readable manner
    • @ThrottleSkip() now takes in an object with string boolean to say which throttler should be skipped
    • ttl and limit are no longer optional in the module's options. If an option object is passed, it must define the defaults for that throttler

    HOW TO MIGRATE

    For most people, wrapping your options in an array will be enough.

    If you are using a custom storage, you should wrap you ttl and limit in an array and assign it to the throttlers property of the options object.

    Any @ThrottleSkip() should now take in an object with string: boolean props. The strings are the names of the throttlers. If you do not have a name, pass the string 'default', as this is what will be used under the hood otherwise.

    Any @Throttle() decorators should also now take in an object with string keys, relating to the names of the throttler contexts (again, 'default' if no name) and values of objects that have limit and ttl keys.

    IMPORTANT: The ttl is now in miliseconds. If you want to keep your ttl in seconds for readability, usethe seconds helper from this package. It just multiplies the ttl by 1000 to make it in milliseconds.

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