Pomax / lib-font

This library adds a new Font() object to the JavaScript toolbox, similar to new Image() for images
MIT License
728 stars 72 forks source link

Supports CommonJS #137

Closed yisibl closed 10 months ago

yisibl commented 10 months ago

A lot of historical Node.js projects won't be able to migrate to ESM anytime soon, and I think it would be better to support CommonJS.

Pomax commented 10 months ago

All of them are perfectly capable of converting ESM to CJS themselves using quite a few tool options. If your project is stuck on CJS, it's not the job of your dependencies to stay stuck with you, you'll have to add the tools to pull modern code back into the past yourself.

yisibl commented 10 months ago

Thanks, I've forked and released a separate package containing CJS: https://github.com/yisibl/lib-font/pull/1

Pomax commented 10 months ago

the license certain allows for that, but it's kind of a nonsense thing to do given the JS tools available to everyone in late 2023 to fix this problem if your codebase has a CJS/ESM problem.