
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
promise-all-settled-by-key
Advanced tools
[](https://travis-ci.org/Dobby89/promise-all-settled-by-key) [](https://www.npmjs.com/package/pro
Returns a promise that resolves after all of the given promises have either resolved or rejected, with an object that contains the resolved status and value of each promise.
Promise.allSettled() returns promises in an array with no index or key, so you can't track what happened to which promise.
However, this package makes it possible to determine the outcome and value of specific promises because it returns each promise by key.
npm install promise-all-settled-by-key
import promiseAllSettledByKey from 'promise-all-settled-by-key';
const promiseMap = {
theNumberThree: Promise.resolve(3),
getFoo: new Promise((resolve, reject) => setTimeout(reject, 100, 'foo error'),
nope: new Promise((resolve, reject) => setTimeout(reject, 100))
}
promiseAllSettledByKey(promiseMap).then(settled => {
console.log(settled);
});
// Expected output
// {
// theNumberThree: { resolved: true, value: 3 }
// getFoo: { resolved: false, value: 'foo error' },
// nope: { resolved: false, value: undefined }
// }
You can set { onlyResolved = true }
to return only the resolved promises.
promiseAllSettledByKey(promiseMap, { onlyResolved: true }).then(settled => {
console.log(settled);
});
// Expected output
// {
// theNumberThree: { resolved: true, value: 3 }
// }
You can set { onlyRejected = true }
to return only the rejected promises.
promiseAllSettledByKey(promiseMap, { onlyRejected: true }).then(settled => {
console.log(settled);
});
// Expected output
// {
// getFoo: { resolved: false, value: 'foo error' },
// nope: { resolved: false, value: undefined }
// }
FAQs
[](https://travis-ci.org/Dobby89/promise-all-settled-by-key) [](https://www.npmjs.com/package/pro
The npm package promise-all-settled-by-key receives a total of 2 weekly downloads. As such, promise-all-settled-by-key popularity was classified as not popular.
We found that promise-all-settled-by-key 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.