ysocorp / koa2-ratelimit

Rate-limiting middleware for Koa2 ES6. Use to limit repeated requests to APIs and/or endpoints such as password reset.
MIT License
120 stars 37 forks source link

Marking peer dependencies as optional #47

Closed alexandrebodin closed 2 years ago

alexandrebodin commented 2 years ago

🚀 Feature request

When using this package with one of the providers you will always get peerDependencies warnings because you won't be using all possible providers at once.

With npm v7+ peerDependenciesMeta were introduced to mark peerDependencies as optional. In this package I think it would be a quick win to avoid the npm warnings and make everyone happy :)

Happy to make a PR if someone is ready to merge it and release :)

julienwilmet commented 2 years ago

Hi @alexandrebodin!

You can make a PR, I'll test it on a few existing projects.

How does it work with npm versions < 7?

alexandrebodin commented 2 years ago

Hi,

the peerDependenciesMeta behavior is unchanged for older versions. Npm doesn't know about it and ignores the key.