Gathering detailed insights and metrics for promistein
Gathering detailed insights and metrics for promistein
Gathering detailed insights and metrics for promistein
Gathering detailed insights and metrics for promistein
npm install promistein
Typescript
Module System
NPM Version
69.6
Supply Chain
98.7
Quality
77.4
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
2,185
Last Day
1
Last Week
3
Last Month
16
Last Year
95
7 Commits
3 Watching
1 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
1.0.0
Package Id
promistein@1.0.0
Size
4.97 kB
NPM Version
2.0.0
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
-66.7%
3
Compared to previous week
Last month
220%
16
Compared to previous month
Last year
-4%
95
Compared to previous year
1
bramstein/promis (minified version) for nodejs and browser. Packaged for benchmarks. Very pretty and tiny but one of the slowest in Bluebird's benchmarks. It supports the full Promise API specification.
Install with npm
$ npm install promistein
Run to be sure
$ npm test
The constructor is called with a single function argument.
1var promise = new Promise(function (resolve, reject) { 2 resolve('hello'); 3});
Instances of a Promise have two methods available: then
and catch
. The then
method is used to add callbacks for when the promise is resolved or rejected.
1promise.then(function (x) { 2 console.log('value is', x); 3}, function (r) { 4 console.log('reason is', r); 5});
The catch
method is used the catch rejected promises in a more convenient way.
1promise.catch(function (r) { 2 console.log('reason is', r); 3});
Both methods return a new Promise that can be used for chaining.
The Promise class also has four class methods: resolve
, reject
, race
and all
. The resolve
and reject
methods are a convenient way of creating already settled promises:
1var resolved = Promise.resolve('hello'); 2var rejected = Promise.reject('bye');
The race
method can be used to "race" two or more promises against each other. The returned promises is settled with the result of the first promise that settles.
1// first will be resolved with 'hello' 2var first = Promise.race([new Promise(function (resolve) { 3 setTimeout(function () { 4 resolve('world'); 5 }, 1000); 6}), Promise.resolve('hello')]);
The all
method waits for all promises given to it to resolve and then resolves the promise with the result of all of them.
1// all is settles with ['hello', 'world'] 2var all = Promise.all([Promise.resolve('hello'), Promise.resolve('world')]);
Charlike Mike Reagent
Copyright (c) 2014 Charlike Mike Reagent, contributors.
Released under the MIT
license.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
security policy file detected
Details
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
Found 0/7 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More