Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Weekly downloads
6.2K
increased by9.25%
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc