🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@toon-format/toon

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@toon-format/toon - npm Package Compare versions

Comparing version
2.2.0
to
2.3.0
+10
-4
dist/index.d.mts

@@ -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 @@ * ```

{
"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": {

@@ -7,3 +7,3 @@ ![TOON logo with step‑by‑step guide](./.github/og.png)

[![npm version](https://img.shields.io/npm/v/@toon-format/toon.svg?labelColor=1b1b1f&color=fef3c0)](https://www.npmjs.com/package/@toon-format/toon)
[![SPEC v3.0](https://img.shields.io/badge/spec-v3.0-fef3c0?labelColor=1b1b1f)](https://github.com/toon-format/spec)
[![SPEC v3.2](https://img.shields.io/badge/spec-v3.2-fef3c0?labelColor=1b1b1f)](https://github.com/toon-format/spec)
[![npm downloads (total)](https://img.shields.io/npm/dt/@toon-format/toon.svg?labelColor=1b1b1f&color=fef3c0)](https://www.npmjs.com/package/@toon-format/toon)

@@ -138,5 +138,12 @@ [![License: MIT](https://img.shields.io/badge/license-MIT-fef3c0?labelColor=1b1b1f)](./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