This repository has been archived on 2023-01-08. You can view files and clone it, but cannot push or open issues or pull requests.
ptrcports/jsq/jsq.js
ptrcnull 94703e9182
jsq: upgrade to 2
compiled executable goes brrr
2022-06-20 21:38:44 +02:00

23 lines
529 B
JavaScript

import * as std from "std"
// helper stuff
var url = (text, link) => `\x1b]8;;${link}\x1b\\${text}\x1b]8;;\x1b\\`
var colors = {
reset: `\x1b[0m`,
black: `\x1b[30m`,
red: `\x1b[31m`,
green: `\x1b[32m`,
yellow: `\x1b[33m`,
blue: `\x1b[34m`,
magenta: `\x1b[35m`,
cyan: `\x1b[36m`,
white: `\x1b[37m`,
}
var input = JSON.parse(std.in.readAsString())
var output = eval('input' + scriptArgs.slice(1).join(' '));
if (typeof output === "object") {
console.log(JSON.stringify(output, null, 2))
} else {
console.log(output)
}