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

[Feature]: wasm / pyd build of this tool for using in js/py #118

Open
CNSeniorious000 opened this issue Nov 12, 2024 · 3 comments
Open

[Feature]: wasm / pyd build of this tool for using in js/py #118

CNSeniorious000 opened this issue Nov 12, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@CNSeniorious000
Copy link

Describe the improvement

Is it possible to build this into a WASM, so that JavaScript developers can have a more performant alternative for rehype-remark or turndown?

The difficulty is how to support the plugin ecosystem of html-to-markdown.

@CNSeniorious000 CNSeniorious000 added the enhancement New feature or request label Nov 12, 2024
@JohannesKaufmann
Copy link
Owner

  • WASM is possible with golang (either with the go compiler itself or with "tinygo")
  • I tried it in the past & the project compiled and worked fine 🎉
  • So in theory this should be possible
  • However it would only support a small selection of plugins (similar to the CLI). And this could make it difficult to add external dependencies since not everything is supported by tinygo.
  • @CNSeniorious000 Do you know any npm packages that use this approach? It would be good to have some npm packages as inspiration to see how they implemented it on the TS/JS Side...

@CNSeniorious000
Copy link
Author

CNSeniorious000 commented Nov 12, 2024

Thanks for answering!
It seems that there aren't many JavaScript libraries implemented in Go. The only one I know of is astro/compiler.

@tomkosm
Copy link

tomkosm commented Nov 22, 2024

Another idea would be to make a sharedlib and use ffi, thats how we use this library in nodejs. Example of another npm library doing this https://github.com/DemonMartin/tlsClient .

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

No branches or pull requests

3 participants