Installations
npm install hast-util-is-body-ok-link
Developer Guide
Typescript
Yes
Module System
ESM
Node Version
22.7.0
NPM Version
10.8.3
Score
99.7
Supply Chain
99.4
Quality
80.2
Maintenance
100
Vulnerability
100
License
Releases
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
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
Download Statistics
Total Downloads
19,144,678
Last Day
41,068
Last Week
192,035
Last Month
844,969
Last Year
7,113,128
GitHub Statistics
92 Stars
249 Commits
16 Forks
9 Watching
1 Branches
13 Contributors
Bundle Size
501.00 B
Minified
327.00 B
Minified + Gzipped
Sponsor this package
Package Meta Information
Latest Version
3.0.1
Package Id
hast-util-is-body-ok-link@3.0.1
Unpacked Size
9.47 kB
Size
3.74 kB
File Count
9
NPM Version
10.8.3
Node Version
22.7.0
Publised On
27 Sept 2024
Total Downloads
Cumulative downloads
Total Downloads
19,144,678
Last day
-7.3%
41,068
Compared to previous day
Last week
-15%
192,035
Compared to previous week
Last month
9.6%
844,969
Compared to previous month
Last year
131.1%
7,113,128
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
hast-util-is-body-ok-link
hast
utility to check if a link
element is “body OK”.
Contents
- What is this?
- When should I use this?
- Install
- Use
- API
- Syntax
- Syntax tree
- Types
- Compatibility
- Security
- Contribute
- License
What is this?
This package is a utility that, when given a hast node, checks whether it is a “body OK” link.
When should I use this?
You can use this package to check whether links can exist inside <body>
(outside of <head>
).
Install
This package is ESM only. In Node.js (version 16+), install with npm:
1npm install hast-util-is-body-ok-link
In Deno with esm.sh
:
1import {isBodyOkLink} from 'https://esm.sh/hast-util-is-body-ok-link@3'
In browsers with esm.sh
:
1<script type="module"> 2 import {isBodyOkLink} from 'https://esm.sh/hast-util-is-body-ok-link@3?bundle' 3</script>
Use
1import {h} from 'hastscript' 2import {isBodyOkLink} from 'hast-util-is-body-ok-link' 3 4isBodyOkLink(h('link', {itemProp: 'foo'})) //=> true 5isBodyOkLink(h('link', {rel: ['stylesheet'], href: 'index.css'})) //=> true 6isBodyOkLink(h('link', {rel: ['author'], href: 'index.css'})) //=> false
API
This package exports the identifier
isBodyOkLink
.
There is no default export.
isBodyOkLink(node)
Check whether a node is a “body OK” link.
The following nodes are “body OK” links:
link
elements with anitemProp
link
elements with arel
list where one or more entries arepingback
,prefetch
, orstylesheet
Parameters
node
(Node
) — node to check.
Returns
Whether a node is a “body OK” link (boolean
).
Syntax
HTML is parsed according to WHATWG HTML (the living standard), which is also followed by all browsers.
Syntax tree
The syntax tree used is hast.
Types
This package is fully typed with TypeScript.
Compatibility
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-body-ok-link@^3
,
compatible with Node.js 16.
Security
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.
Contribute
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.
License
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: license:0
- Info: FSF or OSI recognized license: MIT License: license:0
Reason
security policy file detected
Details
- Info: security policy file detected: github.com/rehypejs/.github/security.md:1
- Info: Found linked content: github.com/rehypejs/.github/security.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/rehypejs/.github/security.md:1
- Info: Found text in security policy: github.com/rehypejs/.github/security.md:1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/bb.yml:1
- Warn: no topLevel permission defined: .github/workflows/main.yml:1
- Info: no jobLevel write permissions found
Reason
Found 0/30 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
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/bb.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/rehypejs/rehype-minify/bb.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:6: update your workflow using https://app.stepsecurity.io/secureworkflow/rehypejs/rehype-minify/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:7: update your workflow using https://app.stepsecurity.io/secureworkflow/rehypejs/rehype-minify/main.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/rehypejs/rehype-minify/main.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/main.yml:11
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 2 third-party GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
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 'main'
Score
4.1
/10
Last Scanned on 2025-01-20
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