
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Tag Flow is a simple and resilient HTML parser designed to streamline and enhance your web development workflow. This repository provides tools, utilities, and best practices to help developers efficiently parse and manipulate HTML content.
To install, use npm:
npm install tag-flow
import { flow } from 'tag-flow'
const htmlContent = '<div><h1>Hello</h1> World!</div>';
const fl = flow(htmlContent);
console.log(fl.q("h1").html)
<h1>Hello</h1>
fl.q("h1").setName("h3")
fl.save("new.html");
<div><h3>Hello</h3> World!</div>
fl.q("div")
fl.q(".className")
fl.q("#myId")
// Returns tags containing this text
fl.q("*Hello")
// Add Element to .content
fl.q(".content").addElement({type: "text",text: "Hello World"} as TFText);
// Remove Element from .content
fl.q(".content").remove(0);
// Remove .content
fl.q(".content").remove();
// Remove all children of .content
fl.q(".content").innerHTML = "";
// or
fl.q(".content").removeChildren();
// Add href attribute to all `a` tags
fl.q("a").attr("href", "https://google.com");
// Remove an attribute
fl.q("a").delAttr("href");
// Add inner HTML to query result
fl.q(".content").innerHTML = "<h1>Good Morning</h1>";
// or
fl.q(".content").setInnerHTML("<h1>Good Morning</h1>");
// Get the raw inner HTML as a string
console.log(fl.q(".content").innerHTML);
// Change all `h1` to `h2`
const htmlContent = '<div><h1>Hello</h1> World!</div>';
const fl = flow(htmlContent);
fl.q("h1").name = "h2";
// or
fl.q("h1").setName("h2");
npm install
npm test
Contributions are welcome! Please follow these steps:
git checkout -b feature-name
).git commit -m 'Add feature'
).git push origin feature-name
).This project is licensed under the MIT License.
For questions or feedback, feel free to reach out to the project maintainer at contact@jacoblewis.me
.
FAQs
A Simple and Resilient HTML/XML Parser
The npm package tag-flow receives a total of 48 weekly downloads. As such, tag-flow popularity was classified as not popular.
We found that tag-flow 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
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.