smol-toml

Parse and serialize TOML configuration files into JavaScript data structures.

7|4|Updated Mar 2, 2026
One-click install
npx skills add https://github.com/nklisch/skills --skill smol-toml
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: smol-toml
Source: https://github.com/nklisch/skills/tree/main/.agents/skills/smol-toml
Command: npx skills add https://github.com/nklisch/skills --skill smol-toml

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a compact, spec-compliant way to parse and serialize TOML configuration files into JavaScript objects, removing the friction of handling TOML syntax, date/time semantics, and parse diagnostics across runtimes.

Core Features & Use Cases

  • Parse TOML text into JavaScript-friendly types with a clear TOML-to-JavaScript mapping, including strings, numbers, bigint for out-of-range integers, booleans, arrays, tables, and TomlDate for all TOML date/time variants.
  • Serialize JavaScript objects back to valid TOML while preserving TomlDate formats and correctly emitting arrays, tables, and array-of-tables.
  • TomlError provides precise line and column diagnostics with a code snippet pointer for robust error reporting during config loading and validation.
  • Cross-runtime support for Bun, Node, Deno, and ESM browsers makes it suitable for CLI tools, application config loading, and build-time tooling.

Quick Start

Read a config.toml file, parse it into a JavaScript object, update the configuration values, and write it back to disk using the library's parse and stringify functions.

Frequently Asked Questions about smol-toml

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I parse and serialize TOML configuration files in JavaScript?

You can parse and serialize TOML configuration files in JavaScript by mapping TOML text into JavaScript objects and back, preserving date/time semantics and correctly emitting arrays and tables. This allows programmatic reading and updating of config files.

Does TOML parsing in JavaScript preserve date and time types?

TOML parsing in JavaScript preserves date and time semantics using TomlDate, which handles all TOML date/time variants. When serializing back to TOML, the TomlDate formats are correctly maintained in the output.

How can I get line and column numbers from a TOML parse error?

You can get line and column numbers from a TOML parse error using TomlError, which provides precise diagnostics and a code snippet pointer. This surfaces exact locations for robust error reporting during config loading and validation.

Can I parse TOML in runtimes like Bun, Node, Deno, and ESM browsers?

You can parse TOML in JavaScript runtimes including Bun, Node, Deno, and ESM browsers. This cross-runtime support makes TOML parsing suitable for CLI tools, application config loading, and build-time tooling across different environments.

How are integers and arrays handled when parsing TOML into JavaScript objects?

When parsing TOML into JavaScript objects, integers map to number or bigint for out-of-range values, while arrays must be homogeneous. The parser strictly rejects undefined, null, mixed arrays, and circular references to ensure valid data structures.

What are the limitations when serializing JavaScript objects to TOML?

When serializing JavaScript objects to TOML, the serializer rejects undefined, null, mixed arrays, and circular references. It enforces homogeneous arrays and correctly emits TomlDate formats, arrays, tables, and array-of-tables for valid TOML output.