
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
Work in progress, subject to change
Manipulate strings of HTML, a regex based toolkit with no AST
import { HTMLRx } from 'htmlrx`;
const html = `
<detail open class="dropdown">
<summary>Open<summary>
<ul>
<li><a href="">One</a></li>
<li><a href="">Two</a></li>
<li><a href="">Three</a></li>
</ul>
</details>
`
const newHTML = HTMLRx(html)
.clean() // Remove HTML comments
.select('ul') // Select first 'ul' element
// Once an element is selected you can:
// Change the element's tag and/or attributes
.modify('ol', {class: old => old + 'ordered'})
// Remove everything from inside the element
.empty()
// Remove the element from the HTML
.remove()
// or
// Return the element's attributes
.attrs()
// Return the full element as a string
.element()
// Return element's text
.text()
.walk()import { HTMLRx } from 'htmlrx`;
const html = '
<detail open class="dropdown">
<summary>Open<summary>
<ul>
<li><a href="">One</a></li>
<li><a href="">Two</a></li>
<li><a href="">Three</a></li>
</ul>
</details>
'
const newHTML = HTMLRx(html)
.walk(({index, name, attrs, select}) => {
// Select every element and log it to the console
select()
console.log(this.element())
})
const html = `
<div class="container">
<h1>Title</h1>
<p>Paragraph 1</p>
<p>Paragraph 2</p>
<img src="image.png" alt="Image">
</div>
`
const newHTML = HTMLRx(html)
.select(null, {class: 'container'})
.modify('section', {class: 'new-class'})
.select('h1')
.modify('h2')
.select('p')
.empty()
.select('img')
.modify('figure', {class: 'image-container'})
.HTML
<section class="new-class">
<h2>Title</h2>
<p></p>
<p>Paragraph 2</p>
<figure src="image.png" alt="Image" class="image-container">
</section>
FAQs
Utilities for transforming strings of HTML using regex
The npm package htmlrx receives a total of 7 weekly downloads. As such, htmlrx popularity was classified as not popular.
We found that htmlrx 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
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

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