You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

dom-parse

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dom-parse

HTML/XML to DOM parser for browsers and Node.js

3.2.1
latest
Source
npm
Version published
Weekly downloads
7.5K
7.61%
Maintainers
1
Weekly downloads
 
Created
Source

dom-parse

Parse a string of HTML or XML (including MathML, SVG, XHTML) into a document object.

Uses the HTML template element in browsers and jsdom in Node.js.

Usage

import { parse } from 'dom-parse';

parse(string);

Parameters

  • string String containing HTML or XML to parse.

Return value

DocumentFragment Object containing Node structure of HTML/XML parsed.

Example

import { parse } from 'dom-parse';

parse('Some <em>awesome</em> markup <img src="explosion.gif">');
// returns DocumentFragment(4) [ #text, em, #text, img ]

Keywords

document

FAQs

Package last updated on 05 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts