
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
@phtml/self-closing
Advanced tools
pHTML Self Closing lets you use self-closing tags in HTML.
<div><div class="main"/></div>
<template><slot name="title"/></template>
<custom-element/>
<!-- becomes -->
<div><div class="main"></div></div>
<template><slot name="title"></slot></template>
<custom-element></custom-element>
Note: The <script> and <style> tags are ignored.
Transform HTML files directly from the command line:
npx phtml source.html output.html -p @phtml/self-closing
Add pHTML Self Closing to your project:
npm install @phtml/self-closing --save-dev
Use pHTML Self Closing to process your HTML:
const phtmlSelfClosing = require('@phtml/self-closing');
phtmlSelfClosing.process(YOUR_HTML /*, processOptions, pluginOptions */);
Or use it as a pHTML plugin:
const phtml = require('phtml');
const phtmlSelfClosing = require('@phtml/self-closing');
phtml([
phtmlSelfClosing(/* pluginOptions */)
]).process(YOUR_HTML /*, processOptions */);
pHTML Self Closing runs in all Node environments, with special instructions for:
| Node | CLI | Eleventy | Gulp | Grunt |
|---|
The ignore option defines self-closing elements that will not be expanded.
phtmlSelfClosing({ ignore: 'a' });
<a/>
<custom-element/>
<div/>
<!-- becomes -->
<a/>
<custom-element></custom-element>
<div></div>
The ignore option accepts a string or an array of strings.
phtmlSelfClosing({ ignore: ['a', 'custom-element'] });
<a/>
<custom-element/>
<div/>
<!-- becomes -->
<a/>
<custom-element/>
<div></div>
FAQs
Use self-closing tags in HTML
We found that @phtml/self-closing 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.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.