
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
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 16,444 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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.