Gathering detailed insights and metrics for simple-html-tokenizer
Gathering detailed insights and metrics for simple-html-tokenizer
Gathering detailed insights and metrics for simple-html-tokenizer
Gathering detailed insights and metrics for simple-html-tokenizer
A lightweight JavaScript library for tokenizing non-`<script>` HTML expected to be found in the `<body>` of a document
npm install simple-html-tokenizer
Typescript
Module System
Node Version
NPM Version
99.6
Supply Chain
85.3
Quality
82
Maintenance
100
Vulnerability
100
License
TypeScript (90.64%)
JavaScript (8.95%)
HTML (0.41%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
86 Stars
202 Commits
35 Forks
12 Watchers
19 Branches
21 Contributors
Updated on Mar 11, 2025
Latest Version
0.5.11
Package Id
simple-html-tokenizer@0.5.11
Size
85.70 kB
NPM Version
6.14.4
Node Version
12.16.2
Published on
Feb 03, 2021
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
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 dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/13 approved changesets -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
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
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
90 existing vulnerabilities detected
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