Spaces:
Running
Running
Download tools/lib/play-record-node.mjs from irregular6612/AgentnessArenav2: direct link, hf CLI and curl.
- Browser
- Download file 941 Bytes
-
https://huggingface.co/spaces/irregular6612/AgentnessArenav2/resolve/main/tools/lib/play-record-node.mjs
- Command line
-
hf download hf://spaces/irregular6612/AgentnessArenav2/tools/lib/play-record-node.mjs
-
curl -L -o play-record-node.mjs https://huggingface.co/spaces/irregular6612/AgentnessArenav2/resolve/main/tools/lib/play-record-node.mjs
941 Bytes
| /* tools/lib/play-record-node.mjs โ ์ปค๋์ node ์ ์ฉ ์กฐ๊ฐ. | |
| play-record.mjs ๋ ๋ธ๋ผ์ฐ์ ยทnodeยทDeno ์ธ ๋ฐํ์์ด ๊ฐ์ด ์ด๋ค. node ์์๋ง ํ์ํ | |
| `createRequire`(engine.js / campaign.js ๋ฅผ CommonJS ๋ก ์ก๋ ๋ฐ ์ด๋ค)๋ฅผ ์ฌ๊ธฐ๋ก ๋๋ค. | |
| ์ปค๋์ ์ด ํ์ผ์ **ํจ์ ์์์ ๋์ import** ํ๋ฏ๋ก Deno ๋ ์ด ํ์ผ์ ์์ ํด์ํ์ง | |
| ์๋๋ค โ Edge ๋ฐํ์์ node: ํด๋ฆฌํ์ด ์ ๋ธ๋ ค ์จ๋ค. | |
| ์ด ํ์ผ์ node ๋ฐ์์ import ๋๋ฉด ์ ๋๋ค. ํธ์ถ ๊ฒฝ๋ก๋ loadEngines() ์ else ๋ถ๊ธฐ ํ๋๋ฟ. */ | |
| import { createRequire } from 'node:module'; | |
| import { fileURLToPath } from 'node:url'; | |
| import { dirname, join } from 'node:path'; | |
| export function loadEnginesNode(kernelUrl) { | |
| const req = createRequire(kernelUrl); | |
| const ROOT = join(dirname(fileURLToPath(kernelUrl)), '..', '..'); | |
| return { E: req(ROOT + '/engine.js'), C: req(ROOT + '/campaign.js') }; | |
| } | |