
Research
/Security News
Bitwarden CLI Compromised in Ongoing Checkmarx Supply Chain Campaign
Bitwarden CLI 2026.4.0 was compromised in the Checkmarx supply chain campaign after attackers abused a GitHub Action in Bitwarden’s CI/CD pipeline.
@xylabs/promise
Advanced tools
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
Using npm:
npm install {{name}}
Using yarn:
yarn add {{name}}
Using pnpm:
pnpm add {{name}}
Using bun:
bun add {{name}}
See the LICENSE file for license rights and limitations (LGPL-3.0-only).
### .temp-typedoc
### classes
### <a id="PromiseEx"></a>PromiseEx
An extended Promise that carries an optional attached value and supports cancellation.
The value can be inspected via the then or value methods to conditionally cancel.
Promise<T>T
V = void
new PromiseEx<T, V>(func, value?): PromiseEx<T, V>;
V
PromiseEx<T, V>
Promise<T>.constructor
optional cancelled?: boolean;
Whether the promise has been cancelled via a value callback.
then<TResult1, TResult2>(
onfulfilled?,
onrejected?,
onvalue?): Promise<TResult1 | TResult2>;
Attaches callbacks for the resolution and/or rejection of the Promise.
TResult1 = T
TResult2 = never
((value) => TResult1 | PromiseLike<TResult1>) | null
The callback to execute when the Promise is resolved.
((reason) => TResult2 | PromiseLike<TResult2>) | null
The callback to execute when the Promise is rejected.
(value?) => boolean
Promise<TResult1 | TResult2>
A Promise for the completion of which ever callback is executed.
Promise.then
value(onvalue?): PromiseEx<T, V>;
Inspects the attached value via the callback; if it returns true, marks the promise as cancelled.
(value?) => boolean
A callback that receives the attached value and returns whether to cancel.
PromiseEx<T, V>
This instance for chaining.
### functions
### <a id="fulfilled"></a>fulfilled
function fulfilled<T>(val): val is PromiseFulfilledResult<T>;
For use with Promise.allSettled to filter only successful results
T
PromiseSettledResult<T>
val is PromiseFulfilledResult<T>
### <a id="fulfilledValues"></a>fulfilledValues
function fulfilledValues<T>(previousValue, currentValue): T[];
For use with Promise.allSettled to reduce to only successful result values
T
T[]
PromiseSettledResult<T>
T[]
const resolved = Promise.resolve('resolved')
const rejected = Promise.reject('rejected')
const settled = await Promise.allSettled([resolved, rejected])
const results = settled.reduce(fulfilledValues, [] as string[])
// results === [ 'resolved' ]
const resolved = Promise.resolve('resolved')
const rejected = Promise.reject('rejected')
const settled = await Promise.allSettled([resolved, rejected])
const results = settled.reduce<string[]>(fulfilledValues, [])
// results === [ 'resolved' ]
### <a id="rejected"></a>rejected
function rejected<T>(val): val is PromiseRejectedResult;
For use with Promise.allSettled to filter only rejected results
T
PromiseSettledResult<T>
val is PromiseRejectedResult
### <a id="toPromise"></a>toPromise
function toPromise<T>(value): Promise<T>;
Wraps a value in a Promise if it is not already one.
T
Promisable<T>
A value that may or may not be a Promise.
Promise<T>
A Promise resolving to the value.
### interfaces
### <a id="PromiseType"></a>PromiseType
An interface representing any thenable (promise-like) object.
then: () => unknown;
unknown
### type-aliases
### <a id="AnyNonPromise"></a>AnyNonPromise
type AnyNonPromise = Exclude<TypedValue, PromiseType>;
Any non-promise typed value, excluding thenables.
### <a id="AsyncMutex"></a>AsyncMutex
type AsyncMutex<T> = Promise<T>;
T
Used to document promises that are being used as Mutexes
### <a id="NullablePromisable"></a>NullablePromisable
type NullablePromisable<T, V> = Promisable<T | null, V>;
A Promisable that may resolve to null.
T
V = never
### <a id="NullablePromisableArray"></a>NullablePromisableArray
type NullablePromisableArray<T, V> = PromisableArray<T | null, V>;
A Promisable array where elements may be null.
T
V = never
### <a id="OptionalPromisable"></a>OptionalPromisable
type OptionalPromisable<T, V> = Promisable<T | undefined, V>;
A Promisable that may resolve to undefined.
T
V = never
### <a id="OptionalPromisableArray"></a>OptionalPromisableArray
type OptionalPromisableArray<T, V> = PromisableArray<T | undefined, V>;
A Promisable array where elements may be undefined.
T
V = never
### <a id="Promisable"></a>Promisable
type Promisable<T, V> = PromiseEx<T, V> | Promise<T> | T;
A value that may be a Promise, PromiseEx, or a plain synchronous value.
T
V = never
### <a id="PromisableArray"></a>PromisableArray
type PromisableArray<T, V> = Promisable<T[], V>;
A Promisable that resolves to an array.
T
V = never
### <a id="PromiseExFunc"></a>PromiseExFunc
type PromiseExFunc<T> = (resolve?, reject?) => void;
The executor function passed to the PromiseEx constructor.
T
PromiseExSubFunc<T, void>
PromiseExSubFunc<T, void>
void
### <a id="PromiseExSubFunc"></a>PromiseExSubFunc
type PromiseExSubFunc<T, TResult> = (value) => TResult;
A resolve/reject callback used within PromiseEx.
T
TResult = T
T
TResult
### <a id="PromiseExValueFunc"></a>PromiseExValueFunc
type PromiseExValueFunc<V> = (value?) => boolean;
A callback that inspects the attached value and returns whether to cancel the promise.
V
V
boolean
FAQs
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
The npm package @xylabs/promise receives a total of 3,798 weekly downloads. As such, @xylabs/promise popularity was classified as popular.
We found that @xylabs/promise demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers 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
/Security News
Bitwarden CLI 2026.4.0 was compromised in the Checkmarx supply chain campaign after attackers abused a GitHub Action in Bitwarden’s CI/CD pipeline.

Research
/Security News
Docker and Socket have uncovered malicious Checkmarx KICS images and suspicious code extension releases in a broader supply chain compromise.

Product
Stay on top of alert changes with filtered subscriptions, batched summaries, and notification routing built for triage.