@twometer/icy
v2.0.0
Published
A more concise alternative to 'typed JSON'
Downloads
1
Readme
🧊 icy
Icy is a concise way of storing what I'll call "typed JSON". It occurs when you try to serialize a tag-based markup to JSON.
For example, let's assume you have the following HTML:
<div>Hello, <strong>World</strong></div>
You could represent it in JSON as follows:
{
"type": "div",
"content": [
{
"type": "text",
"text": "Hello, "
},
{
"type": "strong",
"content": [
{
"type": "text",
"text": "World"
}
]
}
]
}
This has the advantage of being a clear and unambiguous representation, but is also quite unwieldy.
I designed icy to alleviate this problem and to store documents like these in a more compact, while still human-readable format.
The above JSON would be converted to:
{div content=[{text text="Hello, "},{strong content=[{text text="World"}]}]}
Which retains the best of both worlds :-)