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
resize-observer-polyfill
A polyfill for the Resize Observer API
rc-resize-observer
Resize observer for React
@juggle/resize-observer
Polyfills the ResizeObserver API and supports box size options from the latest spec
use-resize-observer
A React hook that allows you to use a ResizeObserver to measure an element's size.
npm install resize-observer
Typescript
Module System
Node Version
NPM Version
JavaScript (66.55%)
TypeScript (33.45%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
NOASSERTION License
97 Stars
85 Commits
12 Forks
65 Watchers
11 Branches
5 Contributors
Updated on Jan 28, 2025
Latest Version
1.0.4
Package Id
resize-observer@1.0.4
Unpacked Size
52.70 kB
Size
13.00 kB
File Count
25
NPM Version
6.14.11
Node Version
14.15.5
Published on
Nov 29, 2021
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
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
Found 2/26 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 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
52 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
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