sandbox-yaml
Read and write YAML inside a Code node or CodeAct action, with js-yaml running in the guest
- License 许可
- AGPL-3.0
- 最近更新
- 2026-08-18
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- sandbox-yaml
- description
- Read and write YAML inside a Code node or CodeAct action, with js-yaml running in the guest
02 资源文件 1
- 参考文档package.json820 B
03 SKILL.md 正文
YAML in the sandbox
Specifier: @nodetool-ai/sandbox-yaml. One module, the js-yaml root export.
Declare it in the node's packages property and import it at the top of the
body.
load — YAML text to a value
import yaml from "@nodetool-ai/sandbox-yaml";
const config = yaml.load(inputs.text);
return { name: config.name, replicas: config.replicas };
load reads one document and throws a YAMLException with a line and column
on malformed input. Multi-document files go through loadAll, which returns an
array.
dump — a value to YAML text
import yaml from "@nodetool-ai/sandbox-yaml";
return { text: yaml.dump({ name: inputs.name, tags: inputs.tags }, { indent: 2 }) };
dump throws on a cyclic structure unless you pass { noRefs: false }, and on
a value it cannot represent (a function, a symbol).
Gotchas
- Everything runs in the guest. The 64 MB guest heap holds your input text, the parse tree, and the returned value at once. A file of a few megabytes is fine; a hundred megabytes is not.
- No timers, no I/O. The guest has no
setTimeout, no filesystem, and no Node builtins. js-yaml needs none of them — that is why it is admitted — but code you write around it must not reach for them either. - The safe schema is not the default.
yaml.loadusesDEFAULT_SCHEMA, which resolves tags such as!!timestamp. For input from a stranger, pass{ schema: yaml.FAILSAFE_SCHEMA }and get strings, arrays, and objects only. - This pack is the only route to YAML. There is no
data.parseYamlglobal any more; every library the sandbox offers is an importable module, and this is the one for YAML. A node that needs it declares it.
04 同仓库更多 Skills
sandbox-zip
Read and write zip archives in a Code node or CodeAct action, with fflate running on the host under a 50 MB inflation cap
sandbox-xml
Parse XML feeds and sitemaps in a Code node or CodeAct action, with fast-xml-parser running on the host
sandbox-xlsx
Read and write Excel workbooks in a Code node or CodeAct action, with exceljs running on the host
sandbox-twilio
Send SMS and WhatsApp messages and look up numbers from a Code node or CodeAct action, with NodeTool's Twilio request builder running on the host
sandbox-tfjs
Classify and embed images, detect objects, and answer from a passage in a Code node or CodeAct action, with TensorFlow.js running on the host
sandbox-supabase
Read and write Supabase tables from a Code node or CodeAct action, with NodeTool's PostgREST request builder running on the host