Type: Function

How to get serializeNodeToJsonMl?


import serializeNodeToJsonMl from 'fontoxml-dom-utils/src/serializeNodeToJsonMl.js'

Creates a JsonML representation for the given node.

JsonML is always expected to be a JavaScript structure. If you need a string of JSON, use JSON.stringify afterwards.

As Document nodes are not supported in JsonML, pass Document.documentElement if you need the JsonML representation of a complete document, otherwise Document will be represented as an element with an unexpected nodeName. This will not round-trip.


  1. node


    Type: Node

    Root node of the structure to convert.


Type: JsonML