
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
A tiny utility library to replace callbacks with Promises where possible. Don't callback, callforth!
It simply includes a hand-full of functions I see myself re-implementing in nearly every project. So I might as well put them in a package.
Do things like:
await timeout(3000)
await eventOn(videoElement, "loadeddata")
const message = await eventOn(webWorker, "message")
npm install callforth
Now you can:
import { eventOn, timeout, polling } from "callforth"
Alternatively, include this script and:
<script src="./path/to/callforth.umd.js"></script>
<script>
const { eventOn, timeout, polling } = window.callforth
</script>
eventOnconst payload = await eventOn(target, successEvent, errorEvent)
EventTarget - any object you can call addEventListener on.string - name of the event you want to await.string (optional) - if this event fires, the promise is rejected.Promise<any> - wraps callback result (callbacks first argument)timeoutawait timeout(delay)
int - milliseconds after which the Promise should resolves.Promise<void>pollingawait polling(predicate, { maxTries, interval })
any -> boolean - delay in milliseconds after which the Promise should resolve.object (optional)
int (default = 10) - maximum number of times to call predicate before giving up.int (default = 10) - delay in milliseconds between calls of predicate.Promise<void>async function loadScript(url) {
let script = document.createElement("script")
script.src = url
await eventOn(script, "loaded")
}
async function primesLessThen(number) {
primeWorker.postMessage(number)
const result = await eventOn(primeWorker, "message")
return result
}
FAQs
A tiny utility library to conveniently replace callbacks with Promises.
The npm package callforth receives a total of 13,426 weekly downloads. As such, callforth popularity was classified as popular.
We found that callforth 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 discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.