Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 18, 2024 via pnpm

dom-serializer 2.0.0

render domhandler DOM nodes to a string
Package summary
Share
0
issues
2
licenses
3
BSD-2-Clause
1
MIT
Package created
20 May 2014
Version published
9 Apr 2022
Maintainers
1
Total deps
4
Direct deps
3
License
MIT

Issues

0
This package has no issues

Licenses

BSD 2-Clause "Simplified" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
hold-liable
Must
include-copyright
include-license
3 Packages, Including:
domelementtype@2.3.0
domhandler@5.0.3
entities@4.5.0

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
dom-serializer@2.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

3
All Dependencies CSV
β“˜ This is a list of dom-serializer 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
domelementtype2.3.02.84 kBBSD-2-Clause
prod
domhandler5.0.312.29 kBBSD-2-Clause
prod
entities4.5.075.55 kBBSD-2-Clause
prod

Visualizations

Frequently Asked Questions

What does dom-serializer do?

Dom-serializer is an invaluable tool for rendering domhandler DOM nodes, or an array of these nodes, to a string. Similar to the notion of outerHTML of the passed node(s), dom-serializer assists in effectively converting DOM nodes to a string representation. Whether you're working with Node or an array of Nodes, dom-serializer provides an easy, manageable approach to this task.

How do you use dom-serializer?

Utilizing dom-serializer is straightforward and can be done in just a few lines of code. Firstly, you should import the package into your JavaScript file like so:

import render from "dom-serializer";

For those using require syntax, the import would look like:

const render = require("dom-serializer").default;

In both instances, render is a function that takes a DOM node or an array of DOM nodes and yields a string. It can be invoked with the node(s) you wish to serialize and an optional parameters object for manipulating the serialization:

let result = render(node, options);

In the above snippet, node is the DOM node or an array of DOM nodes to be rendered, and options is a configuration object altering the serialization behavior.

Where are the dom-serializer docs?

Documentation for the dom-serializer can be found right on its GitHub page here. The documentation encompasses a detailed API section that explains how to use the render function that the package exports. In addition, it provides an easy-to-read table of different options you can pass to the render function to change the serialization behavior, complete with defaults and examples of usage.