Gathering detailed insights and metrics for @nfrasser/simple-html-tokenizer
Gathering detailed insights and metrics for @nfrasser/simple-html-tokenizer
npm install @nfrasser/simple-html-tokenizer
Typescript
Module System
Node Version
NPM Version
74.8
Supply Chain
83.9
Quality
75
Maintenance
100
Vulnerability
100
License
TypeScript (86.25%)
JavaScript (13.15%)
HTML (0.6%)
Total Downloads
6,745
Last Day
4
Last Week
9
Last Month
518
Last Year
4,936
3 Stars
203 Commits
1 Forks
2 Watching
4 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
0.5.11-2
Package Id
@nfrasser/simple-html-tokenizer@0.5.11-2
Unpacked Size
191.83 kB
Size
26.26 kB
File Count
17
NPM Version
7.7.6
Node Version
15.13.0
Cumulative downloads
Total Downloads
Last day
100%
4
Compared to previous day
Last week
-82%
9
Compared to previous week
Last month
877.4%
518
Compared to previous month
Last year
674.9%
4,936
Compared to previous year
Simple HTML Tokenizer is a lightweight JavaScript library that can be used to tokenize the kind of HTML normally found in templates. It can be used to preprocess templates to change the behavior of some template element depending upon whether the template element was found in an attribute or text.
It is not a full HTML5 tokenizer. It focuses on the kind of HTML that is
used in templates: content designed to be inserted into the <body>
and without <script>
tags.
In particular, Simple HTML Tokenizer does not handle many states from the HTML5 Tokenizer Specification:
CDATA
or RCDATA
<script>
<DOCTYPE>
It also passes through character references, instead of trying to tokenize and process them, because the preprocessed templates will ultimately be parsed by a real browser context.
At the moment, there are some error states specified by the tokenizer spec that are not handled by Simple HTML Tokenizer. Ultimately, I plan to support all error states, as well as provide information about tokenizer errors in debug mode.
You can tokenize HTML:
1var tokens = HTML5Tokenizer.tokenize("<div id='foo' href=bar class=\"bat\">"); 2 3var token = tokens[0]; 4token.tagName //=> "div" 5token.attributes //=> [["id", "foo"], ["href", "bar"], ["class", "bat"]] 6token.selfClosing //=> false
1npm install 2npm test
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
no SAST tool detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
security policy file not detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
86 existing vulnerabilities detected
Details
Score
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