Installations
npm install rehype-imgload
Developer Guide
Typescript
Yes
Module System
ESM
Node Version
14.21.3
NPM Version
6.14.18
Score
64.6
Supply Chain
83.8
Quality
75.6
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (100%)
Developer
plastic041
Download Statistics
Total Downloads
1,195
Last Day
1
Last Week
1
Last Month
5
Last Year
226
GitHub Statistics
1 Stars
50 Commits
1 Watching
1 Branches
1 Contributors
Bundle Size
765.00 B
Minified
452.00 B
Minified + Gzipped
Package Meta Information
Latest Version
2.0.1
Package Id
rehype-imgload@2.0.1
Unpacked Size
4.78 kB
Size
2.35 kB
File Count
5
NPM Version
6.14.18
Node Version
14.21.3
Publised On
13 Oct 2023
Total Downloads
Cumulative downloads
Total Downloads
1,195
Last day
0%
1
Compared to previous day
Last week
0%
1
Compared to previous week
Last month
0%
5
Compared to previous month
Last year
-39.4%
226
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Dev Dependencies
6
rehype-imgload
Rehype plugin to add loading
property into <img>
tags.
Installation
1# use yarn 2$ yarn add rehype-imgload 3 4# use npm 5$ npm install rehype-imgload
Usage
General Use
Adds loading
property to your <img>
s.
1import rehypeImgLoad from "rehype-imgload"; 2import rehypeParse from "rehype-parse"; 3import rehypeStringify from "rehype-stringify"; 4import { unified } from "unified"; 5 6const processor = unified() 7 .use(rehypeParse) 8 .use(rehypeImgLoad) 9 .use(rehypeStringify); 10 11const output = processor.processSync( 12 '<img src="/example.jpg"><img src="/example.jpg" loading="eager">' 13); 14console.log(output.toString()); 15// '<img src="/example.jpg" loading="lazy"><img src="/example.jpg" loading="eager">' 16// Latter `img` is not changed because `overwrite` is `false` by default. 17// Pass { overwrite: true } option to overwrite existing loading property.
API
This package exports no identifiers. Default export is rehypeImgLoad
.
unified().use(rehypeImgLoad[, options])
All options are optional.
options.overwrite
boolean
. default=false
- If
false
, existingloading
properties will remain unchanged. - If
true
, allloading
properties will be overwritten toloading=options.mode
(see below).
options.mode
"lazy" | "eager"
, default="lazy"
Indicates how the browser should load the image. MDN Reference
LICENSE
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
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
Found 0/22 approved changesets -- score normalized to 0
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
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/plastic041/rehype-imgload/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/plastic041/rehype-imgload/main.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/plastic041/rehype-imgload/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/plastic041/rehype-imgload/main.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/plastic041/rehype-imgload/main.yml/main?enable=pin
- Info: 0 out of 3 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 2 third-party GitHubAction dependencies pinned
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/main.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
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
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 14 are checked with a SAST tool
Score
3.4
/10
Last Scanned on 2025-01-06
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