# jsdon **Repository Path**: mirrors_WebReflection/jsdon ## Basic Information - **Project Name**: jsdon - **Description**: A DOM serializer based on LinkeDOM idea - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-02-11 - **Last Updated**: 2025-12-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # JSDON [](https://travis-ci.com/WebReflection/jsdon) [](https://coveralls.io/github/WebReflection/jsdon?branch=main) **Social Media Photo by [Reign Abarintos](https://unsplash.com/@jareeign) on [Unsplash](https://unsplash.com/)** A DOM de/serializer based on [LinkeDOM](https://github.com/WebReflection/linkedom#readme) idea and the *JSDON* specification (which is something I've just made up). ## Why I like the idea we can represent the *DOM* linearly, and we can travel via `postMessage` or any other capable *JSON* PL anything we like, simplifying diffing, when needed, updates, changes, and so on. This module just provides the basics to transform back and forward any document as JSON, enabling new ways to deal with Web pages, SVG images, or XML documents. ## JavaScript DOM Object Notation This notation considers two kinds of representations, plus one: * a **leaf** is a *node* that cannot contain anything else * a **branch** is a *node* that can contain either branches or leafs * a **tree** is a *branch* extension that represents a whole *document* ### Leaf A leaf is represented by its type, and at least one, or more, *string* values, representing data the leaf carries with it. ```js // attribute node [2,"name"] [2,"name","value"] // text node [3,"content"] // comment node [8,"content"] // document type node (either html or svg) [10,"html"] ``` ### Branch A branch is represented by its type, followed by zero, one, or more leafs, or branches. A branch has a delimiter too, but multiple delimiters get merged as summary of their value. ```js // element //
[1,"div",-1] // element with attributes //between
after