basic-toml
v0.3.1
Published
A simple TOML subset parser
Downloads
24
Readme
basic-toml
A simple TOML subset parser. ~540 bytes minified with brotli.
TOML Subset
- key / value pairs
- quoted or non-quoted, optionally dotted (within tables and arrays of tables), keys such as
key
orkey.sub
or"my-key.same"
- no spaces around dots in keys
- quoted or non-quoted, optionally dotted (within tables and arrays of tables), keys such as
- strings
- prefer double quotes but it works with single quotes too
- no multiline
- integers and floats
- must be compatible with JSON
- boleans
- all JSON compatible dates
- arrays
- also multiline arrays
- tables
- inline tables
- arrays of tables
# any single line comment
packages = ['a', 'b'] # or end comment
# any propety as object (or nested objects)
[field]
simple = true
version = 0 # any JSON compatible value ... and ...
# ... dates are returned as Date instance
when = 1979-05-27T07:32:00-08:00
# quoted keys
"inline" = { OK = true, key = "value" }
# array of JSON compatible entries
[[externals]]
src = 'https://cdn.spot.on'
name = 'spot-on'
[[externals."special.case"]]
ok = true
[[preload]]
files = [
'./3rd-party.js',
'./other.js'
]