Installations
npm install resize-observer
Releases
Unable to fetch releases
Developer
pelotoncycle
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
14.15.5
NPM Version
6.14.11
Statistics
98 Stars
85 Commits
12 Forks
66 Watching
11 Branches
5 Contributors
Updated on 08 Apr 2024
Bundle Size
3.89 kB
Minified
1.33 kB
Minified + Gzipped
Languages
JavaScript (66.55%)
TypeScript (33.45%)
Total Downloads
Cumulative downloads
Total Downloads
21,457,051
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
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
resize-observer
This library aims to be a faithful implementation and ponyfill of the Resize Observer draft. An optional polyfill option exists as well.
Installation
resize-observer
is available on NPM and Yarn:
1> npm install resize-observer
1> yarn add resize-observer
Setup
As a ponyfill/module
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);
As a polyfill
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/* ... */
TypeScript definitions
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
- Info: project has a license file: LICENSE:0
- Warn: project license file does not contain an FSF or OSI license.
Reason
branch protection is not maximal on development and all release branches
Details
- Info: 'allow deletion' disabled on branch 'master'
- Info: 'force pushes' disabled on branch 'master'
- Warn: required approving review count is 1 on branch 'master'
- Warn: codeowners review is not required on branch 'master'
- Warn: no status checks found to merge onto branch 'master'
- Info: PRs are required in order to make changes on branch 'master'
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
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 13 are checked with a SAST tool
Reason
47 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-6chw-6frg-f759
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw
- Warn: Project is vulnerable to: GHSA-wg6g-ppvx-927h
- Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9
- Warn: Project is vulnerable to: GHSA-vh7m-p724-62c2
- Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w
- Warn: Project is vulnerable to: GHSA-434g-2637-qmqr
- Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m
- Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw
- Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p
- Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747
- Warn: Project is vulnerable to: GHSA-qh2h-chj9-jffq
- Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9
- Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f
- Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p
- Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv
- Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8
- Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65
- Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh
- Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44
- Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988
- Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq
- Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm
- Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp
- Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546
- Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-282f-qqgm-c34q
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-hxm2-r34f-qmc5
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m / GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-w9mr-4mfr-499f
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-xc7v-wxcw-j472
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Score
2.5
/10
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