Gathering detailed insights and metrics for vue-coe-image
Gathering detailed insights and metrics for vue-coe-image
npm install vue-coe-image
Typescript
Module System
Node Version
NPM Version
72.4
Supply Chain
98.4
Quality
75.8
Maintenance
100
Vulnerability
100
License
JavaScript (72.68%)
Vue (17.05%)
HTML (6.56%)
CSS (3.71%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
8,675
Last Day
19
Last Week
54
Last Month
148
Last Year
1,567
3 Stars
72 Commits
2 Watchers
7 Branches
1 Contributors
Updated on Jan 25, 2022
Minified
Minified + Gzipped
Latest Version
0.2.4
Package Id
vue-coe-image@0.2.4
Unpacked Size
17.94 kB
Size
4.50 kB
File Count
6
NPM Version
8.6.0
Node Version
14.19.0
Cumulative downloads
Total Downloads
Last Day
850%
19
Compared to previous day
Last Week
170%
54
Compared to previous week
Last Month
108.5%
148
Compared to previous month
Last Year
-1.9%
1,567
Compared to previous year
6
Component for progressive and lazy rendering images inspired by:
Intersection Observer API
✨ Example✨
Explanation https://developers.google.com/web/tools/lighthouse/audits/offscreen-images
Disclaimer
In the past, it was very difficult and expensive to detect the visibility of a particular element.
The Intersection Observer API solves this problem in a really organized, efficient and performative way. It provides a workable template that we can observe to be notified when an element enters the viewport.
Competitive Diferentials
Warning
The IntersectionObserver API is not fully supported by all modern browsers just yet, but there’s a polyfill for it maintained by the w3c.
Install
yarn add vue-coe-image
Include Plugin (to import globally)
1import Vue from 'vue' 2 3import 'vue-coe-image/dist/vue-coe-image.css' 4import { VueCoeImage } from 'vue-coe-image' 5 6Vue.use(VueCoeImage)
Register in component (to import locally)
1<script> 2import VueCoeImage from 'vue-coe-image' 3 4export default { 5 components: { VueCoeImage } 6 ... 7</script>
Pay Attention
You need to import the style file so the animations will work!
I recommend doing this on a global level.
1import 'vue-coe-image/dist/vue-coe-image.css'
Use
1<template> 2 <div> 3 <vue-coe-image 4 :src="src" 5 fallback="https://i.ytimg.com/vi/Yt9t9e9gmmw/maxresdefault.jpg" 6 /> 7 <button @click="changeImage">coe</button> 8 </div> 9</template> 10 11<script> 12import VueCoeImage from 'vue-coe-image' 13 14export default { 15 components: { VueCoeImage }, 16 17 data () { 18 return { 19 src: 'https://3.bp.blogspot.com/-PRG407gZ9bE/V0TCSHFQKcI/AAAAAAAADjE/KbkLmxIXcjMcx4hKTFnDSQxcdPqGuNNWwCLcB/s1600/flamengologo.png' 20 } 21 }, 22 23 methods: { 24 changeImage () { 25 this.src = 'https://www.urbanarts.com.br/imagens/produtos/065033/Detalhes/urubu-do-mengao.jpg' 26 } 27 } 28} 29</script>
A Note on Performance
Observe the elements occupy memory and CPU!
For this reason, immediately after finding the element, we use an instance method named disconnect to stop observing and make the lib more performative.
Name | type | required | About |
---|---|---|---|
loaderImage | String | false | shows while the image is not loaded (has a default) |
src | String | true | Image to load when crossing viewport |
srcset | String | false | Images to be used for different resolutions |
fallback | String | false | Also known as a 'placeholder', this prop avoids an error if it fails or delays loading the image. |
animation | Bollean | false | Animation handler (default is true) |
intersectionOptions | Object | false | options by mdn |
delay | String | false | Delay to show image |
blurLevel | Number | false | Blur animation |
duration | Number | false | Animation duration time |
Name | About |
---|---|
intersect | Triggered when the image crosses the viewport for more complex animations and state manipulation |
error | Triggered when an image upload error occurs |
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 0/30 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
no SAST tool detected
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
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
46 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-02-03
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