
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
provides a promise-based mechanism for locking around code which requires synchronization
Provides a promise-based mechanism for locking around code which requires synchronization (i.e. you may want to synchronize functions that span multiple iterations of the event loop).
npm install --save mutex-js
const Mutex = requires('mutex-js');
const mutex = new Mutex();
mutex.lock(() => {...});
Below, we call an async function run
several times with different args (the calls will run in parallel).
The function reads data from a file, appends the input to the data and finally writes the modified data back to the file.
Without synchronization, each call to run
may overlap the results of the previous one.
Wrapping the function implementation in a locking mechanism ensures that only one call is executing the critical section at a time.
const mutex = new Mutex();
// reads file, returns a promise with file data
const readFromFile = () => {...}
// appends arg to data, returns a promise with modified data
const appendData = (data, arg) => {...}
// writes data to file, returns a promise
const writeToFile = (data) => {...}
const run = (arg) =>
mutex.lock(
readFromFile()
.then(data => appendData(data, arg))
.then(writeToFile)
);
Promise.all([
run('foo'),
run('bar')
])
.then(...)
.catch(...)
FAQs
provides a promise-based mechanism for locking around code which requires synchronization
The npm package mutex-js receives a total of 73 weekly downloads. As such, mutex-js popularity was classified as not popular.
We found that mutex-js 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.