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.
eprom
is an enhanced promise implementation. It works by wrapping a globally available Promise
class and is as compliant with the Promises/A+ spec as the global Promise
is.
In addition to the usual then
, call
and finally
instance methods, it provides resolve
and reject
methods. In this regard, it resembles jQuery's Deferred
object. On top of that, it features a reset
method that enables repeat fulfillment.
Using NPM:
npm install -S eprom
Using Yarn:
yarn add eprom
eprom
's EnhancedPromise
mimics more usual Promises
in every way. As such, it provides all class (resolve
, reject
, all
, race
) and instance (then
, catch
, finally
) methods these provide.
enhancedPromise.resolve(value)
This method resolves an EnhancedPromise
's inner Promise
, triggering the execution of all onFulfilled
handlers.
const enhancedPromise = new EnhancedPromise();
enhancedPromise.then(value => console.log(value));
enhancedPromise.resolve('foo');
// logs 'foo'
enhancedPromise.reject(reason)
This method rejects an EnhancedPromise
's inner Promise
, triggering the execution of all onRejected
handlers.
const enhancedPromise = new EnhancedPromise();
enhancedPromise.catch(reason => console.err(reason));
enhancedPromise.reject('bar');
// logs 'bar'
enhancedPromise.reset()
This method creates a fresh inner Promise
and thus allows for the re-fulfillment of an EnhancedPromise
. A typical use case for this is handling repeat builds triggered by Webpack in watch mode.
const enhancedPromise = new EnhancedPromise();
enhancedPromise.then(value => console.log(value));
enhancedPromise.resolve('foo');
// logs 'foo'
enhancedPromise.reset();
enhancedPromise.then(value => console.log(value));
enhancedPromise.resolve('bar');
// logs 'bar'
FAQs
JavaScript Async Primitive
We found that eprom demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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.