Download scripts/io.mjs from xjackkx/s2: direct link, hf CLI and curl.
- Browser
- Download file 610 Bytes
-
https://huggingface.co/spaces/xjackkx/s2/resolve/main/scripts/io.mjs
- Command line
-
hf download hf://spaces/xjackkx/s2/scripts/io.mjs
-
curl -L -o io.mjs https://huggingface.co/spaces/xjackkx/s2/resolve/main/scripts/io.mjs
610 Bytes
| export function outputLine(...values) { | |
| writeLine(process.stdout, values); | |
| } | |
| export function errorLine(...values) { | |
| writeLine(process.stderr, values); | |
| } | |
| function writeLine(stream, values) { | |
| stream.write(`${values.map(formatValue).join(" ")}\n`); | |
| } | |
| function formatValue(value) { | |
| if (value instanceof Error) return value.stack || value.message; | |
| if (typeof value === "string") return value; | |
| if (value === null || value === undefined) return String(value); | |
| if (typeof value === "object") { | |
| try { | |
| return JSON.stringify(value); | |
| } catch (_) { | |
| return String(value); | |
| } | |
| } | |
| return String(value); | |
| } | |