
Security News
Packagist Urges Immediate Composer Update After GitHub Actions Token Leak
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.
@js-bits/dom-parser
Advanced tools
This package uses built-in DOMParser in a browser and jsdom module in a Node.js environment and exports parse function.
Install with npm:
npm install @js-bits/dom-parser
Install with yarn:
yarn add @js-bits/dom-parser
Import where you need it:
import parse from '@js-bits/dom-parser';
or require for CommonJS:
const parse = require('@js-bits/dom-parser');
const xml = `<?xml version="1.0" encoding="utf-8"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
`;
const doc = parse(xml); // Document
console.log(doc.querySelectorAll('heading')); // NodeList
Optionally accepts second mimeType parameter ("text/xml" by default).
const svg = `<svg xmlns="http://www.w3.org/2000/svg" height="100" width="100" viewBox="0 0 100 100">
<circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />
</svg>
`;
const doc = parse(svg, 'image/svg+xml'); // Document
console.log(doc.querySelectorAll('circle')); // NodeList
FAQs
Cross-environment (nodejs/web) DOM parser for XML and HTML
The npm package @js-bits/dom-parser receives a total of 294 weekly downloads. As such, @js-bits/dom-parser popularity was classified as not popular.
We found that @js-bits/dom-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.

Research
GemStuffer abuses RubyGems as an exfiltration channel, packaging scraped UK council portal data into junk gems published from new accounts.

Company News
Socket was named to the Rising in Cyber 2026 list, recognizing 30 private cybersecurity startups selected by CISOs and security executives.