Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use CommonJS instead of ES Modules? #10

Open
dminkovsky opened this issue Feb 19, 2022 · 2 comments
Open

Use CommonJS instead of ES Modules? #10

dminkovsky opened this issue Feb 19, 2022 · 2 comments

Comments

@dminkovsky
Copy link

Thank you for this awesome library.

A question: ES modules are great but still not exactly widely supported. They cause all kinds of issues with node and related tooling, such as Jest and TypeScript. Would it be possible to make the block.js import in the JS version use a require() instead?

@dminkovsky
Copy link
Author

dminkovsky commented Feb 19, 2022

Oh I am seeing #4 has this...

If there's a concern that replacing ESM w/ CommonJS would break existing users, you could just add another file with the CommonJS version. It's just one function and would increase usability a lot. Currently I have vendored this lib.

@hearmeneigh
Copy link

For anyone else looking for a quick fix, you can use patch package NPM and
this patch to get AnyAscii to work with CommonJS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants