Open bendavis78 opened 3 years ago
The TOML spec Array provide a sample write with a pseudo JSON object as element.
contributors = [
"Foo Bar <foo@example.com>",
{ name = "Baz Qux", email = "bazqux@example.com", url = "https://example.com/bazqux" }
]
I think you can just use this object as key/value
contributors = { name = "Baz Qux", email = "bazqux@example.com", url = "https://example.com/bazqux" }
Other solution can be usage of TOML Table
[dog."tater.man"]
type.name = "pug"
The above table should be generate the below JSON
{ "dog": { "tater.man": { "type": { "name": "pug" } } } }
this lib doesn't support that
https://github.com/BinaryMuse/toml-node/blob/4bad34e1dc81586e799e269e5d2c78662b6657b2/index.js#L4-L9
this lib doesn't support that
https://github.com/BinaryMuse/toml-node/blob/4bad34e1dc81586e799e269e5d2c78662b6657b2/index.js#L4-L9
Is there any lib that supports it?
@dzcpy looks like this one does: https://github.com/tauri-apps/tauri-toml but the last commit was in 2019 :/
You can search for other here: https://npms.io/search?q=toml
@dzcpy looks like this one does: https://github.com/tauri-apps/tauri-toml but the last commit was in 2019 :/
You can search for other here: https://npms.io/search?q=toml
Thanks for your reply. I found this one might be a better alternative. It supports TOML 0.5 https://npmjs.com/package/@iarna/toml
Serializing toml is a strange requirement in my opinion, after all, Object2toml can have many different results. Maybe template strings are better suited for this?
How do you write a js object to a TOML file?