A TOML parser for JavaScript and TypeScript. Fully tested and 100% compatible with the TOML v1.0.0 spec. Support Node.js, browsers and Bun⚡️!
js-toml is trusted in production by teams at leading companies and major open-source projects, including:
- Microsoft (in
pyright) - AWS (Amazon Web Services) (in
aws-lambda-rust-runtime) - Mise (a next-gen
asdf) - Open edX (in over 28 packages)
- LINE (in
abc-user-feedback) - MongoDB (in the
snootydocumentation compiler) - ... and many more.
npm install js-tomlor with yarn
yarn add js-tomlor with pnpm
pnpm add js-tomleven support bun!
bun add js-tomlimport {load} from 'js-toml';
const toml = `
title = "TOML Example"
[owner]
name = "Tom Preston-Werner"
dob = 1979-05-27T07:32:00-08:00 # First class dates
`;
const data = load(toml);
console.log(data);Parses a TOML string and returns a JavaScript object.
Under development.
MIT