Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lpil/tom
A pure Gleam TOML parser!
https://github.com/lpil/tom
gleam-lang toml-parser
Last synced: about 1 month ago
JSON representation
A pure Gleam TOML parser!
- Host: GitHub
- URL: https://github.com/lpil/tom
- Owner: lpil
- Created: 2023-11-12T00:11:23.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-07T13:00:52.000Z (11 months ago)
- Last Synced: 2024-05-01T23:06:02.041Z (6 months ago)
- Topics: gleam-lang, toml-parser
- Language: Gleam
- Homepage:
- Size: 45.9 KB
- Stars: 15
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- awesome-gleam - tom - [📚](https://hexdocs.pm/tom/) - A pure Gleam TOML parser! (Packages / Formats)
README
# tom
A Gleam TOML parser!
[![Package Version](https://img.shields.io/hexpm/v/tom)](https://hex.pm/packages/tom)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/tom/)```sh
gleam add tom
```
```gleam
import tomconst config = "
[person]
name = \"Lucy\"
is_cool = true
"pub fn main() {
// Parse a string of TOML
let assert Ok(parsed) = tom.parse(config)// Now you can work with the data directly, or you can use the `get_*`
// functions to retrieve values.tom.get_string(parsed, ["person", "name"])
// -> Ok("Lucy")let is_cool = tom.get_bool(parsed, ["person", "is_cool"])
// -> Ok(True)
}
```Further documentation can be found at .
## Status
The following string escape sequences are not supported yet:
- `\xHH`
- `\uHHHH`
- `\UHHHHHHHH`