How one can build a binary for most platforms?

Hello. Maybe the question is stupid. I'm still not sure what it is ask not fully understand the subject, but maybe things will be a little easier...
The essence of the following. I'm writing a small javascript app for themselves. It just so happens that javascript is not endowed with special abilities when it runs "separately from the browser". Therefore use separate binaries programs written in another language, when you need some more functionality. Now I need the functionality of making screenshots. Googled the app scrot. And... now stumbled upon a problem. And suddenly this program in the OS of the user? Then I need to put binary in a file with my app and run it (this is very rough, everything works wrong, but the essence is the same). But if I'm just going to pull out of its OS scrot, I understand that this is not in General any guarantee that it will work on any other Linux? (or will?) Is there a way to collect binary so that it is equally to run under most Linux (well, I do not mean any server without GUI, and very very perverted Assembly).
July 2nd 19 at 16:56
2 answers
July 2nd 19 at 16:58
July 2nd 19 at 17:00
Electron, NW.js I don't know ... And how to compile for each platform in docks it is written

Find more questions by tags UbuntuLinuxJavaScript