smol-toml

A small, fast, spec-compliant TOML parser and serializer for JavaScript

Library
npm
v1.9.0
311 stars
BSD 3-Clause License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
77 /100 Good
Development Activity 92
Maintenance 96
Community 40
Maturity 52
Momentum 28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
83 /100 Excellent
Architecture 80
Code Quality 85
Innovation 78
Learning Curve 90

smol-toml is a compact TOML v1.1.0 parser and serializer built to fix a gap in the JavaScript ecosystem, where most existing TOML libraries were outdated, unmaintained, or non-compliant with the spec. It exposes just two core functions — parse() and stringify() — plus a TomlDate helper class that correctly represents all four TOML date/time variants (offset date-time, local date-time, local date, local time) using an extended native Date object.

Despite its small surface area, smol-toml passes the vast majority of the official toml-test conformance suite and benchmarks faster than nearly every competing JS TOML parser on both small and multi-megabyte documents, while offering opt-in BigInt support for integers beyond the 53-bit safe range that plain JavaScript numbers can represent.

What You Get

  • A parse() function converting TOML text into plain JavaScript objects, passing nearly all of the official toml-test conformance suite
  • A stringify() function that serializes JS objects back to TOML, correctly round-tripping integers vs floats where possible
  • A TomlDate class distinguishing Offset Date-Time, Local Date-Time, Local Date, and Local Time, each queryable via isDateTime()/isDate()/isTime()/isLocal()
  • Opt-in BigInt integer parsing (integersAsBigInt: true or "asNeeded") for values beyond JavaScript’s 53-bit safe integer range
  • A numbersAsFloat stringify option for end-to-end type preservation between BigInt integers and floating-point numbers
  • Best-in-class benchmarked performance among JS TOML parsers on both spec-example and multi-megabyte documents

Common Use Cases

  • Parsing pyproject.toml-style or Cargo-style configuration files inside JavaScript/TypeScript tooling
  • Reading and writing TOML-based config for CLIs, build tools, and language-server implementations written in JS
  • Round-tripping TOML documents where integer-vs-float type distinctions and TOML date semantics must be preserved
  • Replacing an unmaintained or non-conformant legacy TOML parser in an existing Node.js codebase
  • High-throughput parsing of large TOML documents where parser performance is a meaningful bottleneck

Under The Hood

Architecture: The library is deliberately small and flat — src/parse.ts drives a hand-written recursive-descent-style tokenizer/parser that delegates primitive value parsing to src/primitive.ts (strings, numbers, booleans) and src/date.ts (the four TOML date/time forms), while src/struct.ts assembles parsed key/value pairs into nested objects and arrays-of-tables; src/stringify.ts performs the inverse walk, and src/extract.ts plus src/util.ts hold small shared helpers, with src/error.ts defining a dedicated parse-error type carrying line/column context. Tech Stack: Pure TypeScript with zero runtime dependencies, built and tested via a pnpm workspace (pnpm-workspace.yaml) with a Justfile/mise.toml for task running, and benchmarked against seven competing parsers using the mitata benchmarking library. Code Quality: Correctness is validated against the official toml-lang/toml-test conformance suite via run-toml-test.bash, with explicitly documented, deliberate exceptions (e.g. invalid UTF-8 and some invalid dates are accepted for performance reasons) rather than silent gaps, plus a dedicated test/ directory of unit tests alongside the conformance harness. API Design: The public surface is intentionally minimal — parse(), stringify(), and TomlDate — mirroring the ergonomics of the built-in JSON global (import TOML from 'smol-toml'; TOML.stringify(...)), which keeps the learning curve near zero for anyone already familiar with JSON.parse/JSON.stringify.

Used by 17 apps in this directory

TypeScript
95%
Apache 2.0

AionUi

AI Agents · Productivity

33,179

Free, open-source Cowork desktop app that unifies Claude Code, Codex, Gemini CLI, and 20+ AI agents into a single platform with multi-agent teams, 24/7 cron automation, and zero-config built-in agent.

View details
85
Repo Health
76
Technical
66
Dependency
Built with
TypeScript 95%
Updated 1 months ago
TypeScript
99%
AGPL 3.0

Cherry Studio

AI Assistants

52,202

All-in-one AI desktop client with 300+ assistants and multi-model support

View details
89
Repo Health
84
Technical
70
Dependency
Built with
TypeScript 99%
Updated 1 weeks ago
TypeScript
96%
MIT

deepseek-harness

AI Agents · AI Development · Developer Tools

237,945

An open-source, plugin-based agent harness from DeepSeek AI that runs coding and automation agents across web, desktop, CLI, and SDK surfaces.

View details
81
Repo Health
89
Technical
74
Dependency
Built with
TypeScript 96%
Updated 1 weeks ago
TypeScript
98%
MIT

Kimi Code CLI

AI Agents · AI Code Assistants · Developer Tools

7,705

A single-binary, terminal-native coding agent that reads, edits, and runs code end to end, built by Moonshot AI for Kimi models but pluggable with Anthropic, OpenAI, and Google providers too.

View details
82
Repo Health
87
Technical
67
Dependency
Built with
TypeScript 98%
Updated 1 weeks ago
Rust
56%
Apache 2.0

Magnitude

AI Development · Developer Tools

5,285

An open source inference engine that profiles your hardware, recommends the best local models, and tunes them for the coding agent you already use.

View details
78
Repo Health
83
Technical
71
Dependency
Built with
Rust 56%
TypeScript 18%
Python 11%
Updated 1 weeks ago
TypeScript
88%
MIT

Mistle

AI Agents · Developer Tools

93

Self-hostable platform for running autonomous coding agents in isolated, credentialless sandboxes with brokered credentials, reusable snapshots, and event-driven triggers.

View details
68
Repo Health
76
Technical
70
Dependency
Built with
TypeScript 88%
Rust 11%
Updated 2 months ago
TypeScript
94%
Apache 2.0

NemoClaw

AI Agents · AI Development

22,554

Run AI coding agents like OpenClaw and Hermes securely inside NVIDIA OpenShell sandboxes with a hardened blueprint, routed inference, and lifecycle management through a single CLI.

View details
74
Repo Health
87
Technical
71
Dependency
Built with
TypeScript 94%
Updated 1 weeks ago
TypeScript
97%
GPL 3.0

OpenKnowledge

Code Editors · Knowledge Management · Note Taking

4,337

A beautiful, local-first markdown IDE that turns any git repo into a live collaborative workspace for humans and AI coding agents like Claude, Codex, and OpenCode.

View details
79
Repo Health
89
Technical
64
Dependency
Built with
TypeScript 97%
Updated 1 weeks ago
TypeScript
91%
MIT

OpenClaw

AI Agents · AI Assistants

390,670

An open-source AI assistant that runs on your own hardware and meets you in Discord, Slack, WhatsApp, iMessage, Telegram, and 20+ other channels, with native apps for every major platform.

View details
88
Repo Health
88
Technical
68
Dependency
Built with
TypeScript 91%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers