Callback/Promise Catering Utility

JSON →
library 2.1.1 ·javascript
verified May 27, 2026

catering is a lightweight utility designed to enable JavaScript modules to be consumed seamlessly using both traditional Node.js-style callbacks and modern Promises. It provides `fromCallback` to wrap internal callback-based logic for promise consumption and `fromPromise` to adapt promise-based logic for callback consumption. The package is currently at version 2.1.1 and appears to be in active maintenance, receiving updates as needed. Its primary differentiator is its focused approach to providing this dual-consumption pattern without imposing a heavy dependency footprint. It explicitly handles error propagation in `fromPromise` by calling the callback in a `queueMicrotask` to prevent errors from being caught by the promise chain, ensuring clear error reporting to the consumer. It is suitable for both Node.js (>=6) and browser environments, and ships with TypeScript types.

total hits 21
actors 8 distinct systems
last hit 1d ago human
MetaBot
4
ByteDance
3
GPTBot
2
Script
1
Search engines
2
Humans
1

top countries 🇺🇸 United States · 🇩🇪 Germany · 🇨🇦 Canada · 🇸🇬 Singapore · 🇵🇱 Poland