{"_id":"@1-/yml","_rev":"4-4112594c86a0f83328894b8d76f27f5e","name":"@1-/yml","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"@1-/yml","version":"0.1.0","keywords":[],"author":{"name":"x-at-01@googlegroups.com"},"license":"MulanPSL-2.0","_id":"@1-/yml@0.1.0","maintainers":[{"name":"i18n-now","email":"i18n.site@gmail.com"}],"homepage":"https://github.com/webc-site/npm/tree/main/yml","bugs":{"url":"https://github.com/webc-site/npm/issues"},"dist":{"shasum":"55411e5027aad88f80c967f327e04014caa77854","tarball":"https://registry.npmjs.org/@1-/yml/-/yml-0.1.0.tgz","fileCount":4,"integrity":"sha512-+ONKtRghN0/kM+zCVkJDmTIcgJEHmgh+eCjOj8Uhcz5NP6yn7hJ2Shv7PhXXwi3UQNqdfhBR/vt+IA8YKdh29g==","signatures":[{"sig":"MEYCIQDxsEK2r3UGr3BI7YH/D6jScLNH84Sd+froocbXKNHUMgIhAMdv3zQ3X2xyvhOmM0dD41q+lbquvDKnIpYwdroxR4Yb","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9979},"type":"module","exports":{"./*":"./*"},"_npmUser":{"name":"i18n-now","email":"i18n.site@gmail.com"},"repository":{"url":"git+https://github.com/webc-site/npm.git","type":"git"},"_npmVersion":"11.16.0","description":"[English](#en) | [中文](#zh)","directories":{},"_nodeVersion":"26.2.0","dependencies":{"@3-/read":"^0.1.4"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/yml_0.1.0_1782875719049_0.6715670347935441","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@1-/yml","version":"0.1.1","keywords":["yaml","parser","llm","fault-tolerant","state-machine"],"author":{"name":"x-at-01@googlegroups.com"},"license":"MulanPSL-2.0","_id":"@1-/yml@0.1.1","maintainers":[{"name":"i18n-now","email":"i18n.site@gmail.com"}],"homepage":"https://github.com/webc-site/npm/tree/main/yml","bugs":{"url":"https://github.com/webc-site/npm/issues"},"dist":{"shasum":"6690fca571d35b7e4fe238f182940187ac0d4b01","tarball":"https://registry.npmjs.org/@1-/yml/-/yml-0.1.1.tgz","fileCount":4,"integrity":"sha512-PxbGie0ucIO+PJGEHiWXBrBmikyJIWroa65Kwos9sDep0rBQuWJA8bp5poHdgqPRjHrQp/J3WgItTHnsVNXNGw==","signatures":[{"sig":"MEUCIAiMhPPWXVshb8U9amXQBZuVgDkDsplenV65EKJBw1X/AiEA3L1yHTFssAFLeI9wojvo2vYaHm//zNMIGomvTSYj9VQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10205},"type":"module","exports":{"./*":"./*"},"_npmUser":{"name":"i18n-now","email":"i18n.site@gmail.com"},"repository":{"url":"git+https://github.com/webc-site/npm.git","type":"git"},"_npmVersion":"11.16.0","description":"A minimalist, high-performance, single-pass YAML parser with LLM fault tolerance","directories":{},"_nodeVersion":"26.2.0","dependencies":{"@3-/read":"^0.1.4"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/yml_0.1.1_1783414370859_0.730559247058022","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@1-/yml","version":"0.1.2","keywords":["fault-tolerant","llm","parser","state-machine","yaml"],"author":{"name":"x-at-01@googlegroups.com"},"license":"MulanPSL-2.0","_id":"@1-/yml@0.1.2","maintainers":[{"name":"i18n-now","email":"i18n.site@gmail.com"}],"homepage":"https://github.com/webc-site/npm/tree/main/yml","bugs":{"url":"https://github.com/webc-site/npm/issues"},"dist":{"shasum":"fb178a7b6d5d76556306a8ff7f6121ef111f3366","tarball":"https://registry.npmjs.org/@1-/yml/-/yml-0.1.2.tgz","fileCount":4,"integrity":"sha512-+DfI5a9fI3aiW+LS6qVQ56XW/zukhS+hrbt+dbGy1F1qvzQOXht4l4b4OlQZmh9dOsMkUZkNiYfgGv6ESlHdzQ==","signatures":[{"sig":"MEUCIAHL31LjVJ8X/lakDdRE1aQmDtAWMQJUfxs2iB6pd1RFAiEApxm/ZTcaJqVTQ7vbbjh55DoWw9k9LTJJSVpjZdoOELA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12469},"type":"module","exports":{"./*":"./*"},"_npmUser":{"name":"i18n-now","email":"i18n.site@gmail.com"},"repository":{"url":"git+https://github.com/webc-site/npm.git","type":"git"},"_npmVersion":"11.16.0","description":"A minimalist, high-performance, single-pass YAML parser with LLM fault tolerance","directories":{},"_nodeVersion":"26.2.0","dependencies":{"@3-/read":"^0.1.4"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/yml_0.1.2_1783505348657_0.30145366526441864","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@1-/yml","version":"0.1.3","description":"A minimalist, high-performance, single-pass YAML parser with LLM fault tolerance","keywords":["fault-tolerant","llm","parser","state-machine","yaml"],"homepage":"https://github.com/webc-site/npm/tree/main/yml","license":"MulanPSL-2.0","author":{"name":"x-at-01@googlegroups.com"},"repository":{"type":"git","url":"git+https://github.com/webc-site/npm.git"},"type":"module","exports":{"./*":"./*"},"dependencies":{"@3-/read":"^0.1.4"},"_id":"@1-/yml@0.1.3","bugs":{"url":"https://github.com/webc-site/npm/issues"},"_nodeVersion":"26.2.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-efvF2DLO6pdGdB7lEqyc6VubQIUhexBWAeSKCL++Tumco1kaQ/zl2R3ZDLfN7gvGGqqMZ1jyJyUjfB5D300DqQ==","shasum":"1b4fe17f0ee60131bc62651c28c67f5ca2fb49b3","tarball":"https://registry.npmjs.org/@1-/yml/-/yml-0.1.3.tgz","fileCount":4,"unpackedSize":12080,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDqQ6dAejy73/DEPVukMUXepCtybs6ow1x9SkA7sKA86gIhAPylTph0qPUqeSoTS+QCWm4xsO9sb1GS9DKgGfyfguiO"}]},"_npmUser":{"name":"i18n-now","email":"i18n.site@gmail.com"},"directories":{},"maintainers":[{"name":"i18n-now","email":"i18n.site@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/yml_0.1.3_1784230213938_0.5523972728443127"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-01T03:15:18.861Z","modified":"2026-07-16T19:30:14.205Z","0.1.0":"2026-07-01T03:15:19.171Z","0.1.1":"2026-07-07T08:52:50.978Z","0.1.2":"2026-07-08T10:09:08.800Z","0.1.3":"2026-07-16T19:30:14.076Z"},"bugs":{"url":"https://github.com/webc-site/npm/issues"},"author":{"name":"x-at-01@googlegroups.com"},"license":"MulanPSL-2.0","homepage":"https://github.com/webc-site/npm/tree/main/yml","keywords":["fault-tolerant","llm","parser","state-machine","yaml"],"repository":{"type":"git","url":"git+https://github.com/webc-site/npm.git"},"description":"A minimalist, high-performance, single-pass YAML parser with LLM fault tolerance","maintainers":[{"name":"i18n-now","email":"i18n.site@gmail.com"}],"readme":"[English](#en) | [中文](#zh)\n\n---\n\n<a id=\"en\"></a>\n# @1-/yml : Minimalist High-Fault-Tolerant YAML Parser\n\n- [@1-/yml : Minimalist High-Fault-Tolerant YAML Parser](#1-yml-minimalist-high-fault-tolerant-yaml-parser)\n  - [Functionality](#functionality)\n  - [Usage Demo](#usage-demo)\n  - [Design Rationale](#design-rationale)\n  - [Tech Stack](#tech-stack)\n  - [Code Structure](#code-structure)\n  - [Historical Note](#historical-note)\n  - [About](#about)\n\n## Functionality\n\nDesigned specifically for YAML generated by Large Language Models (LLMs). Conventional parsers fail on common LLM artifacts — irregular indentation, unclosed quotes, empty values, or inline comments. This parser employs a single-pass, stack-based state machine to achieve robust, one-scan parsing.\n\n## Usage Demo\n\n```bash\nbun add @1-/yml\n```\n\n```javascript\nimport load from \"@1-/yml/load.js\";\nimport loads from \"@1-/yml/loads.js\";\n\n// Parse YAML string\nconst obj = loads(\"a: 1\\nb:\\n  c: 2\");\n\n// Parse YAML file\nconst fileObj = load(\"./conf.yml\");\n```\n\n## Design Rationale\n\nCore logic is an indentation-driven stack state machine. Each line undergoes three phases:\n\n1. Indent depth calculation\n2. Key-value boundary detection (quotes, comments)\n3. Dynamic stack update based on relative indent change\n\n![](https://cdn.jsdmirror.com/gh/webc-fs/-@Gu/kQuh5VeFgcXpsrdzxSVg.svg)\n\n## Tech Stack\n\n- Runtime: ES Module (Node.js ≥18 / Bun)\n- Core dependency: `@3-/read` (file I/O)\n\n## Code Structure\n\n```\nsrc/\n├── loads.js     # Primary parser: string → JS object/array\n└── load.js      # File wrapper: path → JS object/array\n```\n\n## Historical Note\n\nYAML was co-designed in 2001 by Clark Evans, Ingy döt Net, and Oren Ben-Kiki as a _human-friendly data serialization language_. Its name — “YAML Ain’t Markup Language” — deliberately rejects markup semantics, prioritizing direct representation of native data structures (mappings, sequences, scalars). This parser honors that ethos: it avoids complex ASTs and backtracking, using only a lean state machine to recover semantic intent from imperfect input.\n\n\n## About\n\nThis library is developed by [WebC.site](https://webc.site).\n\n[WebC.site](https://webc.site): A new paradigm of web development for AI\n\n\n---\n\n<a id=\"zh\"></a>\n# @1-/yml : 极简高容错 YAML 解析器\n\n- [@1-/yml : 极简高容错 YAML 解析器](#1-yml-极简高容错-yaml-解析器)\n  - [功能介绍](#功能介绍)\n  - [使用演示](#使用演示)\n  - [设计思路](#设计思路)\n  - [技术栈](#技术栈)\n  - [代码结构](#代码结构)\n  - [历史故事](#历史故事)\n  - [关于](#关于)\n\n## 功能介绍\n\n专为大语言模型（LLM）生成的 YAML 设计。常规解析器因缩进不齐、引号未闭合、空值或注释干扰等常见瑕疵极易崩溃；本解析器采用单指针前向扫描状态机，一次遍历完成解析，具备强健的容错能力。\n\n## 使用演示\n\n```bash\nbun add @1-/yml\n```\n\n```javascript\nimport load from \"@1-/yml/load.js\";\nimport loads from \"@1-/yml/loads.js\";\n\n// 解析字符串\nconst obj = loads(\"a: 1\\nb:\\n  c: 2\");\n\n// 解析文件\nconst fileObj = load(\"./conf.yml\");\n```\n\n## 设计思路\n\n核心为基于栈的缩进驱动状态机。每行解析包含三阶段：\n\n1. 计算当前缩进深度\n2. 扫描键、值、引号与注释边界\n3. 根据缩进变化动态维护嵌套栈\n\n![](https://cdn.jsdmirror.com/gh/webc-fs/-@8Q/n9SARZIwyESOqnWPWkwA.svg)\n\n## 技术栈\n\n- 运行时：ES Module（Node.js ≥18 / Bun）\n- 核心依赖：`@3-/read`（文件读取）\n\n## 代码结构\n\n```\nsrc/\n├── loads.js     # 主解析器：字符串输入 → JS 对象/数组\n└── load.js      # 文件封装：路径输入 → JS 对象/数组\n```\n\n## 历史故事\n\nYAML 由 Clark Evans、Ingy döt Net 和 Oren Ben-Kiki 于 2001 年联合设计，初衷是成为“人类可读的数据序列化语言”。其名称 “YAML Ain’t Markup Language” 明确拒绝将自身定位为 XML 替代品，而是强调对原生数据结构（映射、序列、标量）的直接表达。本解析器延续这一精神，舍弃复杂语法树与多轮回溯，以极简状态机还原 YAML 的语义本质。\n\n\n## 关于\n\n本库由 [WebC.site](https://webc.site) 开发。\n\n[WebC.site](https://webc.site) : 面向人工智能的网站开发新范式\n\n","readmeFilename":"README.md"}