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

@kitmodule/kittoon

v1.0.2

Published

Convert JavaScript objects into TOON format quickly — lightweight, human-readable, and dependency-free.

Readme

📝 KitTOON by Kitmodule

Convert JavaScript objects into TOON format quickly — lightweight, human-readable, and dependency-free.

English | Tiếng Việt

npm version license

✨ Features

  • 📦 Convert JavaScript objects into TOON format: human-readable, lightweight.
  • 🔢 Automatic uniform array: [N]{field1,field2,...}: in inline or block style.
  • ⚡ Optional flatten / fold keys: flatten nested objects, concatenate keys, or remove ..
  • 💨 Supports array inline [a,b,c] or block - a\n- b.
  • 💎 Vanilla JS, no dependencies.
  • 🔧 Quick helper to convert objects into TOON in a single line: convertTOON(obj).

🚀 Installation

npm

npm install @kitmodule/kittoon

CDN

<script src="https://unpkg.com/@kitmodule/kittoon/dist/kittoon.min.js"></script>

or

<script src="https://cdn.jsdelivr.net/npm/@kitmodule/kittoon/dist/kittoon.min.js"></script>

🧪 Example

const data = {
  project: "KitTOON Demo",
  author: {
    name: "Huỳnh Nhân Quốc",
    location: "Tam Kỳ"
  },
  users: [
    { id: 1, name: "Quốc", age: 25 },
    { id: 2, name: "Nam", age: 30 }
  ],
  tags: ["demo", "kitmodule", "TOON"]
};

// Quick conversion to TOON
console.log(convertTOON(data));

Output:

project: KitTOON Demo
author:
  name: Huỳnh Nhân Quốc
  location: Tam Kỳ
users[2]{id,name,age}:
1,Quốc,25
2,Nam,30
tags: [demo,kitmodule,TOON]

💡 Usage

Browser (CDN)

<script src="https://unpkg.com/@kitmodule/kittoon/dist/kittoon.min.js"></script>
<script>
  const obj = {
    users: [
      { id: 1, name: "Quốc", role: "admin" },
      { id: 2, name: "Nam", role: "user" }
    ]
  };

  // Quick helper
  console.log(convertTOON(obj));

  // Or custom instance
  const toon = new KitTOON(obj)
    .inline()           // enable inline uniform array
    .flatten('user')    // flatten object with prefix 'user'
    .fold(true);        // fold keys (remove dots)

  console.log(toon.convert());
</script>

Node.js / CommonJS

const { KitTOON, convertTOON } = require('@kitmodule/kittoon');

const obj = {
  users: [
    { id: 1, name: "Quốc", role: "admin" },
    { id: 2, name: "Nam", role: "user" }
  ]
};

// Convert object to TOON
const toon = new KitTOON(obj)
  .inline()       // inline uniform array
  .flatten(true)  // flatten object
  .fold(true);    // fold keys

console.log(toon.convert());

// Or use the quick helper
console.log(convertTOON(obj));

🧩 API Reference

new KitTOON(obj)

| Parameter | Type | Description | | --------- | ------ | ---------------------------------- | | obj | object | Plain JavaScript object to convert |

Instance Methods

| Method | Description | | --------------------------- | ------------------------------------------------------------------ | | .inline(enable = true) | Use inline array [1,2,3] or uniform object inline | | .block(enable = true) | Use block array - 1\n- 2 | | .convert() | Convert the object into TOON string | | .fold(prefixOrBoolean) | Fold keys (remove dots) or use a custom prefix | | .flatten(prefixOrBoolean) | Flatten nested object to single-level keys, optionally with prefix | | .delimiter(char) | Change the delimiter for uniform arrays (default: ,) |

Global Helpers

| Function | Description | | ---------------------------- | ------------------------------------------------------ | | convertTOON(obj) | Quick conversion to TOON format | | toonFrontMatter(obj, body) | Convert object to TOON front matter with optional body |

✅ Why KitTOON?

  • Quickly convert object → TOON for configuration, front matter, test data.
  • Human-readable, lightweight, easy to integrate.
  • Provides quick helper and instance customization.

☕ Support the Author

Ko-fi Buy Me a Coffee GitHub Sponsors

🧾 License

Released under MIT License © 2025 Huỳnh Nhân Quốc · Open Source @Kit Module