linaGirl / leaky-bucket

A fast and efficient leaky bucket implementation

Home Page:https://www.npmjs.com/package/leaky-bucket

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot use in browser (uses .mjs, logd is node.js only)

good-idea opened this issue · comments

I'm trying to use this package in a client-side build. I'm unable to do so because .mjs files are not supported (out of the box, at least). Renaming the files to .js works, and the import can be found, but the module also uses logd, which is node.js only as it uses fs.

I made PR that uses rollup to compile both .js and .ejs and replaces logd with debug. Let me know what you think!

Refactored the class. It doesn't depend on node.js anymore and can be executed in the browser.