I
I
Insanus2022-02-03 21:48:46
go
Insanus, 2022-02-03 21:48:46

How can the electron app put a script written in golang?

There is an application written in electron, you need the ability to call a golang script

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rPman, 2022-02-03
@Insanus

you will have to compile the script, either in advance or carry golang with you (google: portable golang) if you also need offline, then load the necessary dependencies in advance to
launch the application from electron:

var child = require('child_process').execFile;
var executablePath = "myapp.exe";
var parameters = ["--my_param"];

child(executablePath, parameters, function(err, data) {
     console.log(err)
     console.log(data.toString());
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question