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
npm install rehype-imgload
Typescript
Module System
Node Version
NPM Version
64.6
Supply Chain
83.8
Quality
75.6
Maintenance
100
Vulnerability
100
License
TypeScript (100%)
Total Downloads
1,195
Last Day
1
Last Week
1
Last Month
5
Last Year
226
1 Stars
50 Commits
1 Watching
1 Branches
1 Contributors
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
Publised On
13 Oct 2023
Cumulative downloads
Total Downloads
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
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
project is not fuzzed
Details
Reason
security policy file not detected
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-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