Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Promise with timeout.
Create a promise which should timeout after N milliseconds. It will be resolved with promise value or rejected with promise error when not timed out, and rejected with timeout error otherwise.
const promto = require('promto')
const promise = new Promise(resolve => setTimeout(resolve, 200))
const promiseWithTimeout = promto(promise, 100, 'Example Promise')
promiseWithTimeout.then(console.log, console.error)
// Error: Example Promise has timed out after 100ms
const promto = require('promto')
const promise = new Promise(resolve => setTimeout(
() => resolve('Promise Result'),
50
))
const promiseWithTimeout = promto(promise, 100, 'Example Promise')
promiseWithTimeout.then(console.log, console.error)
// Promise Result
const promto = require('promto')
const promise = Promise.reject(new Error('Promise Error'))
const promiseWithTimeout = promto(promise, 100, 'Example Promise')
promiseWithTimeout.then(console.log, console.error)
// Error: Promise Error
2017, Sobesednik Media
FAQs
Create a promise with a timeout.
We found that promto 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.