DOM Node to String Serializer

JSON →
library 2.2.1 ·javascript maintenance
verified May 27, 2026

dom-serialize is a JavaScript library designed to convert various types of DOM nodes into an HTML string representation. Unlike the standard `outerHTML` property, it provides robust serialization capabilities for a broader range of DOM entities, including DOM elements, text nodes, attribute nodes, comment nodes, documents, document fragments, doctypes, NodeLists, and arrays of nodes. The current stable version is 2.2.1, released approximately 10 years ago, suggesting a mature and stable, though not actively developed, state. A key differentiator is its extensible serialization logic through a custom 'serialize' event, allowing developers to intercept and override default serialization for specific nodes or even use a one-time serializer function. This provides fine-grained control over the output, making it suitable for scenarios requiring custom HTML generation or specific content filtering. It supports both browser and Node.js environments, though Node.js usage requires a virtual DOM implementation.

total hits 10
actors 4 distinct systems
last hit 5d ago MetaBot
MetaBot
4
GPTBot
2
Script
1

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany