Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
This is one-method library, which main purpose is ability to run provided to this method asynchronous functions in a queue one by one. Please notice, that all provided functions should return a promise and they should be asynchronous. Support for simple functions is not yet implemented, but planned.
Here's just a spec example.
it 'calls callbacks in a queue one by one', (done) ->
asyncFn1 = sinon.spy(=>
dfd = new $.Deferred()
setTimeout ->
dfd.resolve()
, 700
dfd.promise()
)
asyncFn2 = sinon.spy(=>
dfd = new $.Deferred()
setTimeout ->
dfd.resolve()
, 300
dfd.promise()
)
asyncFn3 = sinon.spy(=>
dfd = new $.Deferred()
setTimeout ->
dfd.resolve()
, 100
dfd.promise()
)
AsyncFn.addToCallQueue asyncFn1
AsyncFn.addToCallQueue asyncFn2
AsyncFn.addToCallQueue asyncFn3
expect(asyncFn2).to.be.not.called
expect(asyncFn3).to.be.not.called
setTimeout ->
expect(asyncFn1).to.be.calledOnce
expect(asyncFn2).to.be.calledOnce
expect(asyncFn3).to.be.calledOnce
expect(asyncFn1).to.be.calledBefore asyncFn2
expect(asyncFn2).to.be.calledBefore asyncFn3
done()
, 1500
FAQs
One-function library for calling asynchronous functions one by one in a queue
The npm package async_fn receives a total of 29 weekly downloads. As such, async_fn popularity was classified as not popular.
We found that async_fn demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.