charmbracelet / glow

Render markdown on the CLI, with pizzazz! 💅🏻
MIT License
16.14k stars 352 forks source link

node dist (thanks to webassembly) #303

Closed abernier closed 3 months ago

abernier commented 2 years ago

Node.js is supporting webassembly: https://nodejs.dev/learn/nodejs-with-webassembly

What about compiling a .wasm build in order to execute it from Node.js? What about:

$ npm i glow

I have currently no experience with go, but could help about Node/npm.

Found that quick tutorial https://egghead.io/lessons/go-compile-and-execute-a-go-webassembly-program-with-node for now

wperron commented 2 years ago

Hey 👋 not a maintainer or even a contributor, but what would be the use case for this?

muesli commented 2 years ago

In all theory this is possible with GOOS=js GOARCH=wasm go build. In reality however, there are still a few dependencies that aren't prepared for wasm builds, termenv, viper, console, and clipboard among them.

caarlos0 commented 3 months ago

not in the scope of the project for now. sorry for the delay, closing!

meowgorithm commented 3 months ago

Side note that if we ever do move forward with this, the place to watch would be Bubble Tea:

https://github.com/charmbracelet/bubbletea/pull/887 https://github.com/charmbracelet/bubbletea/pull/748