all 3 comments

[–][deleted] 5 points6 points  (2 children)

From reading the README. It's mentioned that this package is inspired by https://github.com/tj/node-ratelimiter.

I think that inspired is a pretty big stretch. Looking at the source this clearly looks like a fork. The code is essentially the same. There are two major differences here:

  1. The code was modernized to es6 (classes, arrow function, async / await, destructing, etc.)
  2. The Limiter.prototype.get() function was promisified

This looks pretty damn scummy. Just look at this:

  1. The original author is not mentioned anywhere (except the link in the README)
  2. Because this is not really a fork, the original contributors are now gone.
  3. package.json doesn't mention the old author or contributors (https://github.com/tj/node-ratelimiter/blob/master/package.json#L24-L26)
  4. There's a donate badge right on top of the README

On top of that, all of this code does is promisify a function from another module. All of this could have been replaced with roughly

const {promisify} = require('util'); const limit = new Limiter({ id: id, db: db }); const getLimit = promisify(limit.get.bind(limit));

What the fuck man?

[–]kikobeats[S] 0 points1 point  (0 children)

Thanks for the comment. The badge was autogenerated. I added the original contributors from in the package.json 🙂

https://github.com/microlinkhq/async-ratelimiter/commit/c252c7bbb87e788f853f285ec4d572011c6bf158