Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@dvlden/await-it
Advanced tools
A wrapper for async/await calls without the need of try/catch block.
A wrapper for async/await calls without the need of try/catch block.
If someone told you that you should try / catch
once at the root of your application and then do your async calls anywhere in the codebase, they are wrong. You should try / catch
every async / await
call or use .then() / .catch()
chainables. Better than callback hell? I think it leads to similar problem...
This module attempts to solve that nesting hell and instead provide clean and fluent api with tuple destructuring.
Use your favourite package manager... In my case that's pnpm
.
pnpm i @dvlden/await-it
We'll pretend that we have some kind of Promise
already declared globally, to avoid bulky README file.
// Fake Global Promises
const fakeResolve = Promise.resolve({ name: 'Nenad Novakovic', age: 28 })
const fakeReject = Promise.reject(new Error('Rejection reason...'))
import { it } from '@dvlden/await-it'
;(async () => {
interface User {
name: string
age: number
}
const [res] = await it<User>(fakeResolve)
console.log(res.name) // Nenad Novakovic
})()
// Import as CommonJS
const { it } = require('@dvlden/await-it')
// Import as ESM
import { it } from '@dvlden/await-it'
FAQs
A wrapper for async/await calls without the need of try/catch block.
The npm package @dvlden/await-it receives a total of 0 weekly downloads. As such, @dvlden/await-it popularity was classified as not popular.
We found that @dvlden/await-it 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.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.