Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
browser-unhandled-rejection
Advanced tools
A ponyfill/polyfill for browser Promise unhandledrejection
events.
See: https://www.chromestatus.com/features/4805872211460096
npm i browser-unhandled-rejection
or
yarn add browser-unhandled-rejection
This automatically applies the polyfill to the global Promise
object if it is needed.
import {auto} from 'browser-unhandled-rejection';
auto(); // Applies polyfill if necessary to window.Promise
The following snippet is equivalent to auto()
:
import {polyfill} from 'browser-unhandled-rejection';
if (typeof PromiseRejectionEvent !== 'undefined') {
polyfill(); // Polyfills window.Promise
}
This may may useful if you don't want to mutate window.Promise
:
import MyPromise from 'browser-unhandled-rejection';
window.addEventListener('unhandledrejection', () => {
console.log('unhandledrejection was triggered');
});
MyPromise.reject('will trigger unhandledrejection event');
new MyPromise((resolve, reject) => {
reject('will also trigger unhandledrejection event');
});
FAQs
Run browser and node tests with coverage reports
The npm package browser-unhandled-rejection receives a total of 1,207 weekly downloads. As such, browser-unhandled-rejection popularity was classified as popular.
We found that browser-unhandled-rejection demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.