Gathering detailed insights and metrics for @phtml/self-closing
Gathering detailed insights and metrics for @phtml/self-closing
Gathering detailed insights and metrics for @phtml/self-closing
Gathering detailed insights and metrics for @phtml/self-closing
npm install @phtml/self-closing
Typescript
Module System
Min. Node Version
Node Version
NPM Version
64.8
Supply Chain
97.3
Quality
75
Maintenance
100
Vulnerability
100
License
HTML (52.66%)
JavaScript (47.34%)
Total Downloads
1,730
Last Day
1
Last Week
4
Last Month
22
Last Year
226
CC0-1.0 License
3 Stars
6 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Nov 22, 2022
Latest Version
4.2.0
Package Id
@phtml/self-closing@4.2.0
Unpacked Size
14.93 kB
Size
5.35 kB
File Count
8
NPM Version
6.9.0
Node Version
12.1.0
Cumulative downloads
Total Downloads
Last Day
-50%
1
Compared to previous day
Last Week
-33.3%
4
Compared to previous week
Last Month
4.8%
22
Compared to previous month
Last Year
-45.1%
226
Compared to previous year
1
pHTML Self Closing lets you use self-closing tags in HTML.
1<div><div class="main"/></div> 2<template><slot name="title"/></template> 3<custom-element/> 4 5<!-- becomes --> 6 7<div><div class="main"></div></div> 8<template><slot name="title"></slot></template> 9<custom-element></custom-element>
Note: The <script>
and <style>
tags are ignored.
Transform HTML files directly from the command line:
1npx phtml source.html output.html -p @phtml/self-closing
Add pHTML Self Closing to your project:
1npm install @phtml/self-closing --save-dev
Use pHTML Self Closing to process your HTML:
1const phtmlSelfClosing = require('@phtml/self-closing'); 2 3phtmlSelfClosing.process(YOUR_HTML /*, processOptions, pluginOptions */);
Or use it as a pHTML plugin:
1const phtml = require('phtml'); 2const phtmlSelfClosing = require('@phtml/self-closing'); 3 4phtml([ 5 phtmlSelfClosing(/* pluginOptions */) 6]).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.
1phtmlSelfClosing({ ignore: 'a' });
1<a/> 2<custom-element/> 3<div/> 4 5<!-- becomes --> 6 7<a/> 8<custom-element></custom-element> 9<div></div>
The ignore
option accepts a string or an array of strings.
1phtmlSelfClosing({ ignore: ['a', 'custom-element'] });
1<a/> 2<custom-element/> 3<div/> 4 5<!-- becomes --> 6 7<a/> 8<custom-element/> 9<div></div>
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/6 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-05-05
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More