A. Logging & Monitoring
log(fn)→ logs calls and resultstime(fn)→ measures execution timeprofile(fn)→ detailed table of durationchangelog(fn)→ logs changes in object outputsstats(fn)→ tracks number of calls, avg timewatch(fn)→ subscribe to outputsfeedback(fn, logger)→ logs input/output
B. Execution Control
once(fn)→ runs only onceafter(fn, n)→ runs after n callsbefore(fn, n)→ runs at most n timeslimit(fn, max)→ limits number of callslock(fn)→ prevents concurrent executiononcePerArgs(fn)→ runs once per argument comboqueue(fn)→ sequential executiondelayFn(fn, delay)→ delay executiondelayResult(fn, ms)→ delay return valuedelayEach(fn, delayMs)→ sequential with delayafterIdle(fn, timeout)→ browser idle executionsmartIdle(fn, options)→ idle execution with cancel
C. Error Handling & Safety
catch(fn, onError, fallback)→ error catchsandbox(fn, timeout)→ safe execution with error handlingsafeJson(fn)→ catches JSON parsing errorstimeLimit(fn, timeout)→ rejects after timeoutcancelable(fn)→ cancel in-flight promise
D. Input/Output Transformation
validate(fn, validator)→ validate argumentsmask(fn, masker)→ transform argumentsrestrict(fn, isAllowed)→ allow/disallow calltap(fn, tapFn)→ side effect without affecting returntransformOutput(fn, transformer)→ change outputlocale(fn, formatter)→ format input/outputunit(fn, unit)→ wraps output with value/unit/timestamp
E. Caching & Memoization
memo(fn)→ caches resultsreplay(fn)→ returns cached result for identical args
F. Functional Composition
pipe(...fns)→ left-to-right compositionchainable(fn)→ chain calls, collect results
G. Retry & Simulation
retry(fn, retries, delayMs)→ retry failing fnsimulate(fn, options)→ simulate failure/delay/corruptionrandomBehavior(fn, behaviors)→ random behaviorrandomizeArgs(fn)→ shuffle arguments
H. Undo & History
undoable(fn, inverseFn)→ supports undohistory(fn)→ tracks args/results
I. Conditional Execution
ensure(fn, validator)→ ensures output passesfilterArgs(fn, filterFn)→ executes only if condition passesdelayIf(fn, condition, delayMs)→ delays conditionallyalertOn(fn, condition)→ logs alerts if condition truewarnOnArgs(fn, warningFn)→ warns on suspicious inputpredict(fn, modelFn)→ adds prediction based on outputeventual(fn, checkFn, interval)→ polls until condition true
J. Repeat & Batch
repeat(fn, n)→ repeat function n timesbatch(fn, chunkSize, cb)→ executes in chunks
K. Miscellaneous
hook(fn, {before, after})→ pre/post hooksevolve(fn, evolver)→ mutate or extend output