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

Init es-module-lexer synchronously #184

Closed
SukkaW opened this issue Dec 14, 2024 · 0 comments · Fixed by #185
Closed

Init es-module-lexer synchronously #184

SukkaW opened this issue Dec 14, 2024 · 0 comments · Fixed by #185

Comments

@SukkaW
Copy link
Contributor

SukkaW commented Dec 14, 2024

So I want to use es-module-lexer in an ESlint plugin (un-ts/eslint-plugin-import-x#201).

The ESLint plugin requires rules to be synchronous, so await init is really not an option for us. However, I believe it is possible to init wasm synchronously using WebAssembly.Module and WebAssembly.Instance API (at least in Node.js), see https://github.com/nodejs/cjs-module-lexer/blob/8411abde37566a9d5d1e34fe3c6952faae5badc1/src/lexer.js#L111-L119

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

Successfully merging a pull request may close this issue.

1 participant