Socket
Socket
Sign inDemoInstall

hast-util-to-parse5

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hast-util-to-parse5

hast utility to transform hast to Parse5’s AST


Version published
Weekly downloads
3.1M
decreased by-2.69%
Maintainers
2
Weekly downloads
 
Created

What is hast-util-to-parse5?

The `hast-util-to-parse5` package is a utility that converts HAST (Hypertext Abstract Syntax Tree) to Parse5's AST (Abstract Syntax Tree). This is useful for working with HTML in a structured way, allowing for transformations, analysis, and other manipulations.

What are hast-util-to-parse5's main functionalities?

Convert HAST to Parse5 AST

This feature allows you to convert a HAST node to a Parse5 AST node. The code sample demonstrates converting a simple HAST node representing a <div> element into its Parse5 AST equivalent.

const toParse5 = require('hast-util-to-parse5');
const hast = { type: 'element', tagName: 'div', properties: {}, children: [] };
const parse5Ast = toParse5(hast);
console.log(parse5Ast);

Other packages similar to hast-util-to-parse5

Keywords

FAQs

Package last updated on 28 Feb 2020

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