Gathering detailed insights and metrics for rehype-imgload
Gathering detailed insights and metrics for rehype-imgload
Gathering detailed insights and metrics for rehype-imgload
Gathering detailed insights and metrics for rehype-imgload
Rehype plugin for adding loading property of <img> tags.
npm install rehype-imgload
Typescript
Module System
Node Version
NPM Version
TypeScript (100%)
Total Downloads
1,284
Last Day
1
Last Week
5
Last Month
18
Last Year
191
MIT License
1 Stars
50 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Aug 23, 2024
Minified
Minified + Gzipped
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
Published on
Oct 13, 2023
Cumulative downloads
Total Downloads
Last Day
-66.7%
1
Compared to previous day
Last Week
-37.5%
5
Compared to previous week
Last Month
-43.8%
18
Compared to previous month
Last Year
-53.8%
191
Compared to previous year
1
6
Rehype plugin to add loading
property into <img>
tags.
1# use yarn 2$ yarn add rehype-imgload 3 4# use npm 5$ npm install rehype-imgload
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.
This package exports no identifiers. Default export is rehypeImgLoad
.
unified().use(rehypeImgLoad[, options])
All options are optional.
options.overwrite
boolean
. default=false
false
, existing loading
properties will remain unchanged.true
, all loading
properties will be overwritten to loading=options.mode
(see below).options.mode
"lazy" | "eager"
, default="lazy"
Indicates how the browser should load the image. MDN Reference
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
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
Reason
detected GitHub workflow tokens with excessive permissions
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
Score
Last Scanned on 2025-04-28
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