Spaces:
Running
Running
Download tests/bridge.mjs from alphabell/MOSS-Layout-Studio: direct link, hf CLI and curl.
- Browser
- Download file 356 Bytes
-
https://huggingface.co/spaces/alphabell/MOSS-Layout-Studio/resolve/main/tests/bridge.mjs
- Command line
-
hf download hf://spaces/alphabell/MOSS-Layout-Studio/tests/bridge.mjs
-
curl -L -o bridge.mjs https://huggingface.co/spaces/alphabell/MOSS-Layout-Studio/resolve/main/tests/bridge.mjs
356 Bytes
| import { createInterface } from 'node:readline'; | |
| import { compileDraft, parseStrictJSON } from '../layout.mjs'; | |
| for await (const line of createInterface({ input:process.stdin })) { | |
| try { console.log(JSON.stringify({ok:true,result:compileDraft(parseStrictJSON(line))})); } | |
| catch(error) { console.log(JSON.stringify({ok:false,error:error.message})); } | |
| } | |