smol-toml
smol-toml copied to clipboard
A small, fast, and correct TOML (1.0.0) parser and serializer
```toml [features] # Hi! foo = "bar" ``` After parse it and reture the stringify, it Become: ```toml [features] foo = "bar" ``` Is it possible to keep the comments?...
Eg, specify that a field should be a multiline string, or an inline dict.
For example is storing a valid key of TOML, and use it to access a parsed TOML data object.
We are looking for a TOML linter to integrate within [MegaLinter](https://megalinter.io/latest/), and smol is a serious candidate :) I don't see in the documentation a way to call it via...
``` import toml from 'smol-toml' toml.parse('a=9223372036854775807') ``` Expected: `{ a: 9223372036854775807n }` Seen: Exception (`Invalid TOML document: integer value cannot be represented losslessly`)
Added support for BigInt when the number exceeds safe integers. Added formatting for multiline-strings when stringifying. Looks nicer.