Last active
April 1, 2021 04:45
-
-
Save kavun/5718851 to your computer and use it in GitHub Desktop.
JScript in/out console for Windows Script Host
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function print(text) { | |
WScript.Echo('> ' + text); | |
} | |
var stdin = WScript.StdIn; | |
var stdout = WScript.StdOut; | |
var input; | |
do { | |
var input = stdin.ReadLine(); | |
try { | |
print(eval(input)); | |
} catch (e) { | |
print(e.name + ': ' + e.message); | |
} | |
} while (input != 'exit'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
execute with
cscript WSHRepl.js
output with
print('text');