
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
broody-promises
Advanced tools
Broody implementation of Promises/A+.
Broody promises is a minimalistic lightweight (~1.5KB gzipped) implementation of Promises/A+, with ability to retrieve fulfilled value. Of course, it is possible to do that just when all chain of thens and catchs are resolved synchronous. In other way usage of Broodies did not make any sense to you, because it has no any preferences over already existing and great Promises/A+ libraries.
Install with npm
npm install --save broody-promises
var promise, chain;
promise = new Promise(function(resolve, reject) {
// resolve now synchronous
resolve("my value");
});
chain = Promise.sync(function() {
return promise
.then(function(value) {
// again synchronous
return value + "!";
});
});
chain.result(); // my value!
resolver
: Function(resolve: Function(value: any), reject: Function(reason: any)
))onResolve
: Function(value: any)
, onReject
: Function(reason: any)
) -> Promise
onReject
: Function(reason: any)
) -> Promise
anyWay
: Function(error: any, value: any)
) -> Promise
any
Returns resolved value.
Throws an error in two cases:
pending
state.Boolean
Boolean
Boolean
fn
: Function()
) -> any
Enters in a new context with given functon, when any new Promise
(created synchronously) will have synchronous resolution of onFulfilled
and onRejected
callbacks in .then
chains. This brings ability to use .value()
method.
Note, that with this feature, Broodies will not pass the 2.2.4 rule of the Promises/A+ spec.
promises
: Array[Promise]
) -> Promise
value
: any
) -> Promise
Returns new resolved Promise.
error
: any
) -> Promise
Returns new rejected Promise.
FAQs
Broody implementation of Promises/A+
The npm package broody-promises receives a total of 6 weekly downloads. As such, broody-promises popularity was classified as not popular.
We found that broody-promises 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.