chafa icon indicating copy to clipboard operation
chafa copied to clipboard

Javascript Implementation?

Open Rxann opened this issue 2 years ago • 2 comments

Hi, I am wondering if there is a Javascript Implementation of chafa? If so this would be great!

Rxann avatar Jul 12 '22 21:07 Rxann

Hi! It's possible to compile it to WebAssembly, which means you'll be able to use it in a Javascript program.

Now there are no official Wasm builds, but @oakes managed to pull it off in https://github.com/hpjansson/chafa/issues/41. The best I can offer right now is to follow in his footsteps.

I'm open to having a discussion on how this can be made easier; maybe we should integrate the cut-down GLib @oakes made and the config files, plus an ad-hoc build script, something like that. Ideally, ./configure would have a --with-integrated-glib switch and maybe some extra setting for Wasm output, where the config.h and such are generated by Automake, but that's a serious effort and would make configure.ac much bigger.

hpjansson avatar Jul 12 '22 23:07 hpjansson

Javascript bindings exist now, thanks to the amazing work of Héctor Molinero Fernández! Here's his repository: https://github.com/hectorm/chafa-wasm

Please let me know if this is what you had in mind; if so we can close this issue.

hpjansson avatar Jan 08 '24 21:01 hpjansson