Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

libxml.wasm

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libxml.wasm

## Build

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-87.72%
Maintainers
1
Weekly downloads
 
Created
Source

libxml.wasm

Build

# Build also libraries
docker compose up ci
# Build only bindings
docker compose up wasm

Usage

import init from "@libxml/wasm"
const libxml = await init()

const html = `
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Document</title>
</head>
<body>
  <div class="container">
    <h1 class="title">Hello world</h1>
    <p>Text</p>
  </div>
</body>
</html>
`.trim()

const doc = libxml.parseHTML(html)     // Create a document
const nodes = doc.getNode("//div/h1")  // Get a node by xpath
const h1 = nodes[0]                    // Get the first node
console.log(h1.name)                   // "h1"
console.log(h1.content)                // "Hello world"
console.log(h1.attr.class)             // "title"

Keywords

FAQs

Package last updated on 13 May 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