CJS/ESM Libary in GJS? (original) (raw)
March 13, 2023, 10:10am 1
Hi Gnome Community,
I want to develop a little GTK4 Application with gjs and need to use this libary. I tried to figure it our for my self how to integreate this libary in my application but for the last two days I wasn’t able to wrap my head around it.
Could anyone provide me a foolproof tutorial?
fmuellner (Florian Müllner) March 13, 2023, 5:02pm 2
Could anyone provide me a foolproof tutorial?
No. A node library can only be used in gjs if it doesn’t use any node-specific APIs, either directly or indirectly. I’m afraid there’s no way around that, foolproof or otherwise.
ptomato (Philip Chimento) March 13, 2023, 5:46pm 3
There are some pointers in a presentation that I gave a few years ago: https://ptomato.name/talks/las2021/#26
If you can build a bundle with browserify, that will sometimes successfully replace the Node APIs. No guarantee though.
sonny (Sonny Piers) March 13, 2023, 7:40pm 4
I wrote a bit about this here MQTT module for gjs?
Thanks for all your fast answers. I think I will drop this project because I currently haven’t enough knowledge to understand javascript.
system (system) Closed March 28, 2023, 5:24am 6
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.