Skip to content

Instantly share code, notes, and snippets.

@heypoom
Created December 16, 2020 08:42
Show Gist options
  • Save heypoom/6901abc1647c3e577979946cf3c3f3dd to your computer and use it in GitHub Desktop.
Save heypoom/6901abc1647c3e577979946cf3c3f3dd to your computer and use it in GitHub Desktop.
const readline = require("readline")
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
})
const read = (query) => new Promise((r) => rl.question(query, r))
const print = console.log
async function loop() {
const code = await read("> ")
const ans = eval(code)
print(ans)
loop()
}
loop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment