Gathering detailed insights and metrics for resize-observer
Gathering detailed insights and metrics for resize-observer
Gathering detailed insights and metrics for resize-observer
Gathering detailed insights and metrics for resize-observer
npm install resize-observer
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
98 Stars
85 Commits
12 Forks
66 Watching
11 Branches
5 Contributors
Updated on 08 Apr 2024
Minified
Minified + Gzipped
JavaScript (66.55%)
TypeScript (33.45%)
Cumulative downloads
Total Downloads
Last day
-16.1%
22,614
Compared to previous day
Last week
-0.8%
123,606
Compared to previous week
Last month
14.6%
531,137
Compared to previous month
Last year
6.8%
6,314,584
Compared to previous year
This library aims to be a faithful implementation and ponyfill of the Resize Observer draft. An optional polyfill option exists as well.
resize-observer
is available on NPM and Yarn:
1> npm install resize-observer
1> yarn add resize-observer
resize-observer
does not install itself by default. As such, you can import it like any other module:
1import { ResizeObserver } from 'resize-observer'; 2 3const ro = new ResizeObserver(() => console.log('resize observed!')); 4ro.observe(document.body);
resize-observer
provides a file that can be referenced from your browser that automatically installs ResizeObserver
on the global window
object. Both minified and non-minified versions exist, and are found in the package under the
dist/
directory:
1<script src="/node_modules/resize-observer/dist/resize-observer.js"></script> 2<script type="text/javascript"> 3 const ro = new window.ResizeObserver(() => alert('Observing things is super cool!')); 4 /* use your ResizeObserver! */ 5</script>
A install
method is also provided to do the same within your own code:
1import { install } from 'resize-observer'; 2 3install(); 4 5const ro = new window.ResizeObserver(() => alert('Observe all the things!')); 6/* ... */
Note: Calling install
will always overwrite window.ResizeObserver
.
If you'd like to only install resize-observer
when it doesn't already exist,
you can add a simple check before calling install
:
1import { install } from 'resize-observer'; 2 3if (!window.ResizeObserver) install(); 4 5/* ... */
resize-observer
is written in TypeScript.
The definition files are included in the package and should be picked up automatically.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
branch protection is not maximal on development and all release branches
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 2/26 approved changesets -- score normalized to 0
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
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
47 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
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