Installations
npm install promistein
Developer Guide
Typescript
No
Module System
CommonJS
NPM Version
2.0.0
Score
69.6
Supply Chain
98.7
Quality
77.4
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
Download Statistics
Total Downloads
2,185
Last Day
1
Last Week
3
Last Month
16
Last Year
95
GitHub Statistics
7 Commits
3 Watching
1 Branches
1 Contributors
Bundle Size
1.62 kB
Minified
703.00 B
Minified + Gzipped
Package Meta Information
Latest Version
1.0.0
Package Id
promistein@1.0.0
Size
4.97 kB
NPM Version
2.0.0
Total Downloads
Cumulative downloads
Total Downloads
2,185
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
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
1
promistein
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
Install with npm
$ npm install promistein
Promises/A+ 1.1
Run to be sure
$ npm test
API
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')]);
Authors & Contributors
Charlike Mike Reagent
License
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
- Info: security policy file detected: github.com/tunnckoCore/.github/SECURITY.md:1
- Info: Found linked content: github.com/tunnckoCore/.github/SECURITY.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/tunnckoCore/.github/SECURITY.md:1
- Info: Found text in security policy: github.com/tunnckoCore/.github/SECURITY.md:1
Reason
license file detected
Details
- Info: project has a license file: license.md:0
- Warn: project license file does not contain an FSF or OSI license.
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
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
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
3.9
/10
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