Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
create-async-flag
Advanced tools
Simple promise utility for separate, but dependent control flow.
Simple promise utility for separate, but dependent control flow. See example here.
createAsyncFlag()
Creates a flag that can be
set
,unset
, andwait
upon.
import createAsyncFlag from 'create-async-flag'; const flag = createAsyncFlag();
[flag].wait()
Creates a promise that will only resolve once
set
, or resolve immediatly if alreadyset
.
const flag = createAsyncFlag(); async function run() { // ... await flag.wait(); // execution will hault until flag is `set` // ... }
[flag].set()
Marks the flag to be immediatly resolved, and to resolve any currently waiting promises.
const flag = createAsyncFlag(); function log() { flag.wait().then(() => console.log('one')); flag.set(); flag.wait().then(() => console.log('two')); } log(); // => 'one' // => 'two'
[flag].unset()
Marks a flag to wait until set is called again.
const flag = createAsyncFlag(); async function start() { flag.unset(); await flag.wait(); return; // will never return, unless `set` is called }
[flag].isSet()
Returns the current state of the flag.
const flag = createAsyncFlag(); flag.isSet(); // => false flag.set(); flag.isSet(); // => true
FAQs
Simple promise utility for separate, but dependent control flow.
The npm package create-async-flag receives a total of 838 weekly downloads. As such, create-async-flag popularity was classified as not popular.
We found that create-async-flag 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.