
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
promise-over
Advanced tools
A promise extension for over duration, timeout, and expiration.
npm i promise-over
# or using yarn
yarn add promise-over
CDN:
<script src="https://unpkg.com/promise-over/dist/promiseOver.umd.min.js"></script>
Notice that promise-finally polyfill is required if you want to support browsers not supporting promise-finally.
// es5
var promiseOver = require('promise-over')
// es6+
import promiseOver from 'promise-over'
// tree shaking(babel is required)
import promiseOver from 'promise-over/src/promise-over'
import expire from 'promise-over/src/expire'
import over from 'promise-over/src/over'
import timeoutExpire from 'promise-over/src/timeout-expire'
import timeout from 'promise-over/src/timeout'
promiseOver.over(asyncMethod, 5000).then(() => {
// this will be called after over 5 seconds
})
promiseOver.timeout(asyncMethod, () => {
// This would be called if `asyncMethod` was not resolved(or rejected) yet in 5 seconds
}, 5000)
promiseOver.expire(asyncMethod, 5000, new Error('Expired!!!'))
// An error with message `Expired!!!` would be thrown if `asyncMethod` was not resolved(or rejected) yet in 5 seconds
// promiseOver = over + timeout + expire
promiseOver(asyncMethod, overDelay, [timeoutFunction, timeoutDelay], [expireDelay[, thrownOnExpired]])
promiseOver(getPeople(), 1000)
// the same as promiseOver.over(getPeople(), 1000)
promiseOver(getPeople(), 1000, () => showWaitingMessage(), 1000, 5000)
// timeoutExpire = timeout + expire
promiseOver.timeoutExpire(asyncMethod, timeoutFunction, timeoutDelay, [expireDelay[, thrownOnExpired])
promiseOver.timeoutExpire(getPeople(), () => showWaitingMessage(), 1000)
// the same as promiseOver.timeout(getPeople(), () => showWaitingMessage(), 1000)
// example:
promiseOver.timeoutExpire(getPeople(), () => showWaitingMessage(), 1000, 5000)
.catch(err => {
if (promiseOver.isExpireError(err)) {
showExpiredMessage()
}
)
// with async / await
try {
await promiseOver(getPeople(), () => showWaitingMessage(), 1000, 5000)
} catch(err) {
if (promiseOver.isExpireError(err)) {
showExpiredMessage()
}
}
Check timeline here.
FAQs
A promise extension for over duration, timeout, and expiration.
We found that promise-over 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.