Callback/Promise Catering Utility
JSON →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.
Traffic · last 30 days ↑0% vs prev 7d
top countries 🇺🇸 United States · 🇩🇪 Germany · 🇨🇦 Canada · 🇸🇬 Singapore · 🇵🇱 Poland