npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ploon-cli

v1.0.7

Published

CLI tool for PLOON (Path-Level Object Oriented Notation) - Convert JSON/XML/YAML to the most token-efficient format

Readme

🚀 PLOON CLI

Command-line tool for converting data to PLOON format

PLOON achieves 49.1% token reduction vs JSON and 14.1% better than TOON - perfect for optimizing LLM prompts.

Credits

Inspired by TOON Format. PLOON offers an alternative approach using path-based hierarchy instead of indentation, achieving comparable token efficiency with different trade-offs.

npm version License: MIT


📦 Installation

# Install globally
npm install -g ploon-cli

# Or use with npx (no install)
npx ploon-cli data.json

🚀 Quick Start

# Convert JSON to PLOON
ploon data.json

# Save to file
ploon data.json -o output.ploon

# Minify for maximum token efficiency
ploon data.json --minify -o output.min.ploon

# Show token statistics
ploon data.json --stats

💻 Usage

Basic Conversion

# JSON → PLOON (auto-detect format)
ploon data.json

# Explicit input format
ploon --from=json data.json
ploon --from=xml data.xml
ploon --from=yaml data.yaml

Output Options

# Write to file
ploon data.json -o output.ploon

# Minify (token-optimized)
ploon data.json --minify

# Prettify (human-readable)
ploon data.min.ploon --prettify

Convert PLOON Back

# PLOON → JSON
ploon --to=json data.ploon

# PLOON → XML
ploon --to=xml data.ploon -o output.xml

# PLOON → YAML
ploon --to=yaml data.ploon -o output.yaml

Analysis & Validation

# Show token statistics
ploon data.json --stats

# Validate PLOON format
ploon data.ploon --validate

Custom Configuration

# Custom delimiters
ploon data.json --field-delimiter="," --path-separator="/"

# Use config file
ploon data.json --config=custom.json

📋 Command Reference

Options

-o, --output <file>         Output file (default: stdout)
--from <format>             Input format: json|xml|yaml (default: auto)
--to <format>               Output format: json|xml|yaml (from PLOON)
--minify                    Output compact format
--prettify                  Output standard format
--validate                  Validate PLOON format
--stats                     Show token comparison
-c, --config <file>         Custom configuration file
--field-delimiter <char>    Field delimiter (default: |)
--path-separator <char>     Path separator (default: :)
--array-marker <char>       Array size marker (default: #)
-h, --help                  Display help
-v, --version               Display version

📊 Example Output

Input (data.json):

{
  "products": [
    { "id": 1, "name": "Laptop", "price": 999 },
    { "id": 2, "name": "Mouse", "price": 25 }
  ]
}

Command:

ploon data.json --stats

Output:

[products#2](id,name,price)

1:1|1|Laptop|999
1:2|2|Mouse|25

📊 Token Statistics:
   JSON:  166 chars, 29 tokens
   PLOON: 62 chars, 17 tokens
   Savings: 62.7% characters, 41.4% tokens

🎯 Common Use Cases

1. Optimize LLM Prompts

# Convert large dataset for GPT-4
ploon company-data.json --minify -o prompt-data.ploon

# Result: 49% fewer tokens = lower costs!

2. Format Conversion Pipeline

# XML → PLOON → JSON
ploon --from=xml legacy.xml | ploon --to=json -o modern.json

3. Batch Processing

# Convert all JSON files
for file in *.json; do
  ploon "$file" --minify -o "${file%.json}.ploon"
done

4. Validation

# Check if PLOON file is valid
ploon data.ploon --validate && echo "Valid!" || echo "Invalid!"

📚 Format Examples

Simple Array

Input JSON:

{
  "users": [
    { "id": 1, "name": "Alice" },
    { "id": 2, "name": "Bob" }
  ]
}

PLOON Output:

[users#2](id,name)

1:1|1|Alice
1:2|2|Bob

Nested Objects

Input JSON:

{
  "orders": [{
    "id": 101,
    "customer": {
      "name": "Alice",
      "address": {
        "city": "NYC",
        "zip": 10001
      }
    }
  }]
}

PLOON Output:

[orders#1](customer{address{city,zip},name},id)

1:1|101
2 |Alice
3 |NYC|10001

Nested Arrays

Input JSON:

{
  "products": [{
    "id": 1,
    "name": "Shirt",
    "colors": [
      { "name": "Red", "hex": "#FF0000" },
      { "name": "Blue", "hex": "#0000FF" }
    ]
  }]
}

PLOON Output:

[products#1](colors#(hex,name),id,name)

1:1|1|Shirt
2:1|#FF0000|Red
2:2|#0000FF|Blue

📐 Understanding Path Notation

PLOON uses dual path notation to distinguish between arrays and objects:

Array Paths: depth:index

Used for array elements with an index component:

  • 1:1 - First item at depth 1
  • 1:2 - Second item at depth 1
  • 2:1 - First item at depth 2 (nested in 1:1)
  • 3:2 - Second item at depth 3

Object Paths: depth (depth + space)

Used for object elements without an index:

  • 2 - Object at depth 2
  • 3 - Object at depth 3
  • 4 - Object at depth 4

When to Use Each

Arrays (# in schema): Use depth:index format

[products#2](id,name)    ← Array marker #
1:1|1|Laptop             ← Array path
1:2|2|Mouse              ← Array path

Objects ({} in schema): Use depth format

[orders#1](customer{name},id)    ← Object marker {}
1:1|101                          ← Array path (order)
2 |Alice                         ← Object path (customer)

Mixed structures combine both notations seamlessly:

[orders#1](customer{address{city}},items#(name,price),id)

1:1|101                  ← Order (array element)
2 |Alice                 ← Customer (object)
3 |NYC                   ← Address (nested object)
2:1|Laptop|999           ← Item 1 (array element)
2:2|Mouse|25             ← Item 2 (array element)

🔗 Links


📝 Programmatic Usage

For Node.js/TypeScript projects, use the ploon package:

npm install ploon
import { stringify, parse, minify } from 'ploon'

const ploon = stringify({ users: [{ id: 1, name: 'Alice' }] })
const data = parse(ploon)
const compact = minify(ploon)

See the ploon package for full API documentation.


📄 License

MIT © Ciprian Spiridon


Made with ❤️ for LLM optimization