S
S
SokLor2021-10-10 10:07:02
Node.js
SokLor, 2021-10-10 10:07:02

What is the correct way to call scripts and commands from other PLs using Node?

Conventionally, in order to call a function from python or, for example, create a JAR archive, you can use the node's child_process module .

But it requires locally installed Python and JDK.

Are there any alternatives to this method? Hypothetically, to write a universal script and use it as an npm package to create a JAR archive - without having to install the JDK-locally.

In fact, if at all possible, it is enough to set the direction, where to dig and what to read)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Shcherbina, 2021-10-10
@Denis_maker

There are data transfer protocols. For example, via the http protocol, or TCP, if it is something lower-level, by the way, here is a library for working with TCP in a node:
https://nodejs.org/api/net.html
Accordingly, you can make a modular program, where each individual block will be linked to each other (for example: Node + pythone + C + C#). In each module, you need to install a listener on a specific port, read the commands received from there, and after processing, send the response back or to another port, to the next module, something like this. If I wrote too abstractly, I will try to supplement the answer later)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question