Installations
npm install @phtml/self-closing
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>=8.0.0
Node Version
12.1.0
NPM Version
6.9.0
Score
65
Supply Chain
97.3
Quality
75
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
HTML (52.66%)
JavaScript (47.34%)
Developer
phtmlorg
Download Statistics
Total Downloads
1,671
Last Day
1
Last Week
7
Last Month
33
Last Year
317
GitHub Statistics
3 Stars
6 Commits
2 Watching
1 Branches
1 Contributors
Package Meta Information
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
Total Downloads
Cumulative downloads
Total Downloads
1,671
Last day
0%
1
Compared to previous day
Last week
-30%
7
Compared to previous week
Last month
230%
33
Compared to previous month
Last year
-1.2%
317
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
pHTML Self Closing
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.
Usage
Transform HTML files directly from the command line:
1npx phtml source.html output.html -p @phtml/self-closing
Node
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 |
---|
Options
ignore
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
- Info: project has a license file: LICENSE.md:0
- Info: FSF or OSI recognized license: Creative Commons Zero v1.0 Universal: LICENSE.md:0
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
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
3
/10
Last Scanned on 2025-01-27
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