Taritsyn/JavaScriptEngineSwitcher

[Q&A] How to pass stdio to nodejs

soroshsabz opened this issue · 5 comments

ITNOA

I want to link my stdio from C# Console Application to NodeJs, to better describe my question, I create a sample like below

I have some code like below

            IJsEngine engine = new NodeJsEngine(new NodeSettings { UseBuiltinLibrary = true});
            engine.ExecuteFile("SpawnServer.js");

and my SpawnServer.js is like below

const { spawn } = require("child_process");

console.log('Hi');
process.stdout.write("Hi");
spawn("npx", ["ansible-language-server"].concat(" --stdio"), { stdio: 'inherit' });

I like to see Hi in my C# Console Application, But I do not know, How to do it?

Note: All code is in https://github.com/soroshsabz/visualstudio-ansible/tree/features/4-support-ansible-language-server

thanks

I add this question in SO

Hello!

I think this question should be asked to @JeremyTCD.

@Taritsyn thanks for reply, you correct, but I ask this question in this Repo, because I want to know, Did you have implement any interface for passing stdio from C# to NodeJs or not?

thanks

… Did you have implement any interface for passing stdio from C# to NodeJs or not?

Currently, there are no interop features in the JavaScriptEngineSwitcher.Node module, because there are no corresponding features in current stable version of the Jering.Javascript.NodeJS library.

Thanks for response, So I close this issue, if backend library, support this, feature, I ask you to reopen this issue

thanks again