
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
libxml2-wasm
Advanced tools
There are two common ways to implement an xml library for nodeJs:
Both of these methods have advantages and disadvantages:
Now we have a third way to implement an xml library for nodeJs: compile libxml2 to WebAssembly and use it as a javascript module. This approach has several benefits:
https://jameslan.github.io/libxml2-wasm/index.html
This library is an ES module and uses top level await, it requires the minimum version of the following environments,
| Environment | Version |
|---|---|
| NodeJs | v14.8+ |
| Chrome | V89+ |
| Edge | V89+ |
| Safari | v15+ |
npm i libxml2-wasm
libxml2-wasm is an ES module, importing it are different between ES module and commonJS module.
Import it directly.
import fs from 'node:fs';
import { parseXmlBuffer, parseXmlString } from 'libxml2-wasm';
const doc1 = parseXmlString('<note><to>Tove</to></note>');
const doc2 = parseXmlBuffer(fs.readFileSync('doc.xml'));
doc1.dispose();
doc2.dispose();
Dynamic import is needed:
const fs = require('node:fs');
import('libxml2-wasm').then(({ parseXmlBuffer, parseXmlString }) => {
const doc1 = parseXmlString('<note><to>Tove</to></note>');
const doc2 = parseXmlBuffer(fs.readFileSync('doc.xml'));
doc1.dispose();
doc2.dispose();
});
Note: dispose() is required to avoid memory leak.
For more detail, see the API Doc.
FAQs
WebAssembly-based libxml2 javascript wrapper
The npm package libxml2-wasm receives a total of 2,408 weekly downloads. As such, libxml2-wasm popularity was classified as popular.
We found that libxml2-wasm demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.