Modules@robinpath/promise

@robinpath/promise

0.1.1Public

Async utilities: parallel, race, waterfall, map, retry, throttle, debounce, timeout, and concurrency control

@robinpath/promise

Async utilities: parallel, race, waterfall, map, retry, throttle, debounce, timeout, and concurrency control

Category Functions Auth License

Why use this module?

The promise module lets you:

  • Wait for all promises
  • Wait for all promises (no throw)
  • First promise to settle
  • First promise to fulfill
  • Add timeout to promise

All functions are callable directly from RobinPath scripts with a simple, consistent API.

Installation

npm install @robinpath/promise

Quick Start

No credentials needed — start using it right away:

promise.allSettled [$p1, $p2]

Available Functions

FunctionDescription
promise.allWait for all promises
promise.allSettledWait for all promises (no throw)
promise.raceFirst promise to settle
promise.anyFirst promise to fulfill
promise.timeoutAdd timeout to promise
promise.delayResolve after delay
promise.retryRetry function with backoff
promise.parallelRun functions with concurrency limit
promise.waterfallRun functions in sequence, passing results
promise.mapMap items with async function
promise.filterFilter items with async predicate
promise.eachIterate with async function
promise.reduceReduce with async function
promise.throttleThrottle function calls
promise.debounceDebounce function calls
promise.deferredCreate deferred promise
promise.sleepSleep for milliseconds

Examples

Wait for all promises (no throw)

promise.allSettled [$p1, $p2]

First promise to settle

promise.race [$p1, $p2]

First promise to fulfill

promise.any [$p1, $p2]

Integration with RobinPath

import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/promise";

const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);

const result = await rp.executeScript(`
  promise.allSettled [$p1, $p2]
`);

Full API Reference

See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.

Related Modules

License

MIT

Versions (1)

VersionTagPublished
0.1.1latestyesterday
Install
$ robinpath install @robinpath/promise
Version0.1.1
LicenseMIT
Unpacked Size5.3 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

Category

devops