jhurliman / node-rate-limiter

A generic rate limiter for node.js. Useful for API clients, web crawling, or other tasks that need to be throttled
MIT License
1.51k stars 135 forks source link

Drop just-performance, ttypescript, use *.js imports, create cjs/esm package.json files, bump deps #96

Closed jhurliman closed 6 months ago

jhurliman commented 6 months ago

This is an alternative to https://github.com/jhurliman/node-rate-limiter/pull/92 that drops the just-performance dependency in favor of directly using performance (available in node global namespace since 16.x) and adds a create-package-json.js script that outputs package.json files with type commonjs/module into the dist/cjs and dist/esm output folders. The imports have been changed to use a .js extension to make this library compatible with node.js >=16.x, bundlers such as webpack, or directly in the browser using ESM.

Fixes #80, #93.