Gathering detailed insights and metrics for hast-util-is-javascript
Gathering detailed insights and metrics for hast-util-is-javascript
npm install hast-util-is-javascript
Typescript
Module System
Node Version
NPM Version
94.8
Supply Chain
99.4
Quality
80.3
Maintenance
100
Vulnerability
100
License
7.0.1
Published on 27 Sept 2024
rehype-minify-whitespace@6.0.1
Published on 17 Sept 2024
hast-util-minify-whitespace@1.0.0
Published on 17 Sept 2024
rehype-remove-comments@6.1.0
Published on 17 Sept 2024
html-enumerated-attributes@1.1.0
Published on 01 Nov 2023
7.0.0
Published on 30 Aug 2023
JavaScript (100%)
Total Downloads
1,045,196
Last Day
4,040
Last Week
19,552
Last Month
80,648
Last Year
702,701
92 Stars
249 Commits
16 Forks
9 Watching
1 Branches
13 Contributors
Minified
Minified + Gzipped
Latest Version
3.0.1
Package Id
hast-util-is-javascript@3.0.1
Unpacked Size
11.06 kB
Size
3.95 kB
File Count
9
NPM Version
10.8.3
Node Version
22.7.0
Publised On
27 Sept 2024
Cumulative downloads
Total Downloads
Last day
5.8%
4,040
Compared to previous day
Last week
-5.3%
19,552
Compared to previous week
Last month
12.3%
80,648
Compared to previous month
Last year
235%
702,701
Compared to previous year
2
hast
utility to check if an element is a JavaScript script.
This package is a utility to check whether a hast node is a <script>
that
contains or references JavaScript.
You can use this package to check whether <script>
elements contain or
reference JavaScript or something else.
This package is ESM only. In Node.js (version 16+), install with npm:
1npm install hast-util-is-javascript
In Deno with esm.sh
:
1import {isJavaScript} from 'https://esm.sh/hast-util-is-javascript@3'
In browsers with esm.sh
:
1<script type="module"> 2 import {isJavaScript} from 'https://esm.sh/hast-util-is-javascript@3?bundle' 3</script>
1import {h} from 'hastscript' 2import {isJavaScript} from 'hast-util-is-javascript' 3 4isJavaScript(h('script')) //=> true 5isJavaScript(h('script', {type: 'text/ecmascript'})) //=> true 6isJavaScript(h('script', {language: 'ecmascript'})) //=> true 7isJavaScript(h('script', {type: 'text/fooscript'})) //=> false 8isJavaScript(h('script', {language: 'fooscript'})) //=> false
This package exports the identifier
isJavaScript
.
There is no default export.
isJavaScript(node)
Check if a node is a <script>
that contains or references JavaScript.
Returns true
if node
is a <script>
element that has a valid JavaScript
type
, has no type
and a valid JavaScript language
, or has neither.
node
(Node
) — node to checkWhether a node is a <script>
that contains or references JavaScript
(boolean
).
HTML is parsed according to WHATWG HTML (the living standard), which is also followed by all browsers.
The syntax tree used is hast.
This package is fully typed with TypeScript.
Projects maintained by the unified collective are compatible with maintained versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
hast-util-is-javascript@^3
,
compatible with Node.js 16.
As rehype works on HTML and improper use of HTML can open you up to a
cross-site scripting (XSS) attack, use of rehype can also be unsafe.
Use rehype-sanitize
to make the tree safe.
See contributing.md
in rehypejs/.github
for ways
to get started.
See support.md
for ways to get help.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
security policy file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no SAST tool detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
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