Gathering detailed insights and metrics for mq-polyfill
Gathering detailed insights and metrics for mq-polyfill
Gathering detailed insights and metrics for mq-polyfill
Gathering detailed insights and metrics for mq-polyfill
@babel/helper-define-polyfill-provider
Babel helper to create your own polyfill provider
postcss-media-minmax
Using more intuitive `>=`, `<=`, `>`, `<` instead of media queries min/max prefix.
babel-plugin-polyfill-corejs2
A Babel plugin to inject imports to core-js@2 polyfills
babel-plugin-polyfill-regenerator
A Babel plugin to inject imports to regenerator-runtime
npm install mq-polyfill
97.5
Supply Chain
83.9
Quality
75.7
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
29 Stars
46 Commits
5 Forks
3 Watching
2 Branches
2 Contributors
Updated on 24 Feb 2023
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-28.7%
4,581
Compared to previous day
Last week
4.6%
30,812
Compared to previous week
Last month
11.7%
136,629
Compared to previous month
Last year
-2%
1,460,303
Compared to previous year
CSSOM-valid and jsdom/Jest-compatible matchMedia polyfill for server-side unit tests.
1npm install --save-dev mq-polyfill
1import { jsdom } from 'jsdom'; 2import matchMediaPolyfill from 'mq-polyfill'; 3 4const window = jsdom().defaultView; 5 6/** 7 * Define the window.matchMedia 8 */ 9matchMediaPolyfill(window); 10 11window 12 .matchMedia('(min-width: 920px)') // Create MediaQueryList instance 13 .addListener(console.log); // Subscribe to MQ mode changes 14 15/** 16 * For dispatching resize event 17 * we must implement window.resizeTo in jsdom 18 */ 19window.resizeTo = function resizeTo(width, height) { 20 Object.assign(this, { 21 innerWidth: width, 22 innerHeight: height, 23 outerWidth: width, 24 outerHeight: height, 25 }).dispatchEvent(new this.Event('resize')); 26}; 27 28window.resizeTo(800, 600); 29// console.log() output: 30// MediaQueryList { media: '(min-width: 920px)', matches: false } 31 32window.resizeTo(720, 480); 33// Do nothing (MQ mode heven't changed) 34 35window.resizeTo(1024, 768); 36// console.log() output: 37// MediaQueryList { media: '(min-width: 920px)', matches: true }
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/29 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
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
71 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
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