Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
In modules world, there's possiblity that two different instance of same modules (e.g. installed in different node_modules
) are being run in same process.
If for any reason they need to operate on context instance that's same for the given application or process, then ocassionally introduced multiple installations may break the application.
This module provides interface wich can be used by those to modules to ensure that no matter how many instances of given module are loaded, in all cases they end with same context instance.
// No matter how many instances of given module are loaded in the process, they will always end with same context instance
const globalContext = require("uni-global")("my-scope-name");
// globalContext is a plain object, on which needed global data can be stored.
globalContext.someSingletonData = ...
If there's a need to adapt other environment realm (e.g. coming from iframe) to share same uni-global directory.
Register it with adaptRealm
util as below:
const adaptRealm = require("uni-global/adapt-realm");
adaptRealm(iFrameWindow); // Pass global object of the other realm
npm install uni-global
FAQs
Global namespace without polluting the global scope
The npm package uni-global receives a total of 590,699 weekly downloads. As such, uni-global popularity was classified as popular.
We found that uni-global 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.