diff --git a/dump-env.mjs b/dump-env.mjs new file mode 100755 index 0000000..11d89f3 --- /dev/null +++ b/dump-env.mjs @@ -0,0 +1,19 @@ +#!/bin/sh +//bin/sh -c :; exec node "$0" -- "$@"; # -*- JS -*- + +import print from "./print.mjs"; + +const str = print(globalThis, "globalThis", { + all: true, + colours: true, + proto: true, + maxDepth: Infinity, +}); + +if("object" === typeof console && console && "function" === typeof console.log) + console.log(str); + +else if("function" === typeof globalThis.print && globalThis.print !== print) + globalThis.print(str); + +else throw str;