2.0.0 • Published 2 years ago

@twometer/icy v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

🧊 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 :-)