Closed blueberry6401 closed 3 years ago
It appears that they have changed the package to ES modules. This requires that you now import the package into your app using
import { RateLimiter } from "limiter";
Instead of the old way const RateLimiter = require(
limiter).RateLimiter;
Although it's still not clear why the maintainers made the decision to change this. It would help if they added a CHANGELOG
It also requires the application to be a module.
This library is now distributed using both CommonJS and ESM formats. It looks like Node.js is pulling in the CommonJS file (see the /cjs/
file path) which uses require()
statements, but the "type": "module"
in package.json is forcing it into ESM mode. https://github.com/jhurliman/node-rate-limiter/pull/79 should fix this.
Hi, I got this message
When trying to require
const RateLimiter = require('limiter').RateLimiter;
Node: v15.14.0 Limiter: 2.0.1 Note that I previously used v1.1.3 and this does not happen.