@toon-format/toon
Advanced tools
+10
-4
@@ -167,6 +167,9 @@ //#region src/constants.d.ts | ||
| * encode({ users: [{ id: 1 }, { id: 2 }] }) | ||
| * // users[]: | ||
| * // - id: 1 | ||
| * // - id: 2 | ||
| * // users[2]{id}: | ||
| * // 1 | ||
| * // 2 | ||
| * | ||
| * encode({ tags: [] }) | ||
| * // tags: [] | ||
| * | ||
| * encode(data, { indent: 4, keyFolding: 'safe' }) | ||
@@ -188,5 +191,8 @@ * ``` | ||
| * | ||
| * decode('users[]:\n - id: 1\n - id: 2') | ||
| * decode('users[2]:\n - id: 1\n - id: 2') | ||
| * // { users: [{ id: 1 }, { id: 2 }] } | ||
| * | ||
| * decode('tags: []') | ||
| * // { tags: [] } | ||
| * | ||
| * decode(toonString, { strict: false, expandPaths: 'safe' }) | ||
@@ -193,0 +199,0 @@ * ``` |
+2
-2
| { | ||
| "name": "@toon-format/toon", | ||
| "type": "module", | ||
| "version": "2.2.0", | ||
| "version": "2.3.0", | ||
| "description": "Token-Oriented Object Notation (TOON) – Compact, human-readable, schema-aware encoding of JSON for LLM prompts", | ||
@@ -36,3 +36,3 @@ "author": "Johann Schopplich <hello@johannschopplich.com>", | ||
| "devDependencies": { | ||
| "@toon-format/spec": "^3.0.3" | ||
| "@toon-format/spec": "^3.2.0" | ||
| }, | ||
@@ -39,0 +39,0 @@ "scripts": { |
+12
-4
@@ -7,3 +7,3 @@  | ||
| [](https://www.npmjs.com/package/@toon-format/toon) | ||
| [](https://github.com/toon-format/spec) | ||
| [](https://github.com/toon-format/spec) | ||
| [](https://www.npmjs.com/package/@toon-format/toon) | ||
@@ -138,5 +138,12 @@ [](./LICENSE) | ||
| ## What's New in v3.2 | ||
| - Strict mode rejects duplicate sibling keys; with `strict: false` the last value wins. | ||
| - Malformed array headers (`[03]`, `[1] foo:`, header/field delimiter mismatch) error in strict mode instead of silently degrading. | ||
| - Tabular form excludes arrays that contain an empty `{}` element – those fall back to the expanded list form. | ||
| - Nested arrays-of-objects can appear as list items via an explicit `- [N]:` header. | ||
| ## Media Type & File Extension | ||
| By convention, TOON files use the `.toon` extension and the provisional media type `text/toon` for HTTP and content-type–aware contexts. TOON documents are always UTF-8 encoded; the `charset=utf-8` parameter may be specified but defaults to UTF-8 when omitted. See [SPEC.md §18.2](https://github.com/toon-format/spec/blob/main/SPEC.md#182-provisional-media-type) for normative details. | ||
| By convention, TOON files use the `.toon` extension and the provisional media type `text/toon` for HTTP and content-type–aware contexts. TOON documents are always UTF-8 encoded; the `charset=utf-8` parameter may be specified but defaults to UTF-8 when omitted. See [SPEC.md §17](https://github.com/toon-format/spec/blob/main/SPEC.md#17-iana-considerations) for normative details. | ||
@@ -822,3 +829,3 @@ ## When Not to Use TOON | ||
| The [TOON Playground](https://toonformat.dev/playground) lets you convert JSON to TOON in real-time, compare token counts, and share your experiments via URL. | ||
| The [TOON Playground](https://toonformat.dev/playground) lets you convert JSON or YAML to TOON in real time, compare token counts, and share your experiments via URL. | ||
@@ -904,4 +911,5 @@ ### Community Playgrounds | ||
| - [CLI](https://toonformat.dev/cli/) – Command-line tool for JSON↔TOON conversions | ||
| - [Playgrounds](https://toonformat.dev/ecosystem/tools-and-playgrounds) – Interactive tools | ||
| - [Tooner](https://github.com/chaindead/tooner) – MCP proxy that converts JSON tool responses to TOON | ||
| - [Using TOON with LLMs](https://toonformat.dev/guide/llm-prompts) – Prompting strategies & validation | ||
| - [Playgrounds](https://toonformat.dev/ecosystem/tools-and-playgrounds) – Interactive tools | ||
@@ -908,0 +916,0 @@ ### References |
Sorry, the diff of this file is too big to display
121637
4.84%2032
6.89%931
0.87%