engineer-man / piston

A high performance general purpose code execution engine.
https://emkc.org/run
MIT License
1.95k stars 251 forks source link

No proper way of taking process.stdin input using JavaScript? #670

Open Omar-Walid-MD opened 5 months ago

Omar-Walid-MD commented 5 months ago

Functions like prompt() and readLine() aren't defined and their packages cannot be imported. Is there a way to read input using JavaScript?

Brikaa commented 5 months ago

You need to use the NodeJS ways of getting the stdin like process.stdin image

Omar-Walid-MD commented 5 months ago

Thanks. Is there any way it can be used in a function that works in a similar way to python's input? Something like "const n = input()"

Brikaa commented 5 months ago

There are multiple ways to read from stdin in NodeJS. You can use ones that don't require external NPM modules.