1.0.0 • Published 6 months ago

js-toml v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

js-toml

codecov github actions License: MIT npm version

A TOML parser for JavaScript and TypeScript. Fully tested and 100% compatible with the TOML v1.0.0 spec.

Installation

npm install js-toml

or with yarn

yarn add js-toml

or with pnpm

pnpm add js-toml

Usage

import { 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);

API

load(toml: string): object

Parses a TOML string and returns a JavaScript object.

dump(object: object): string

Under development.

License

MIT

References

TOML v1.0.0 Official Specs

TOML GitHub Project

TOML Test

iarna-toml