Analysis updated 2026-07-05 · repo last pushed 2020-07-21
Modernize an older callback-based JavaScript library so you can write await-style code.
Avoid deeply nested callbacks by wrapping individual functions to return promises.
Selectively convert a module's functions to promises while excluding specific properties.
| boneskull/promwrap | loafdaddy/discoverr-bot | adm1nsys/safari-ai-extension | |
|---|---|---|---|
| Stars | 7 | 7 | 8 |
| Language | JavaScript | JavaScript | JavaScript |
| Last pushed | 2020-07-21 | — | — |
| Maintenance | Dormant | — | — |
| Setup difficulty | easy | moderate | hard |
| Complexity | 2/5 | 2/5 | 2/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Install via npm and import it into your JavaScript project, no extra infrastructure needed.
Promwrap is a small JavaScript utility that converts old-style functions into modern promise-based ones. Many existing code libraries use a pattern where functions accept a "callback", a function you pass in that gets triggered when the work is done, often returning errors as the first argument. This was the standard way to handle asynchronous tasks before promises became common. This tool automatically wraps those callback-style functions so you can use them with await instead, making your code cleaner and easier to read. At a high level, it inspects an object or module and looks for functions that use callbacks. When you call one of those functions through the wrapper, it intercepts the call, runs the original function, and returns a promise. That promise resolves with the result once the callback fires, or rejects if an error occurs. It uses a JavaScript feature called a Proxy to dynamically wrap the object, meaning it returns a modified version that behaves like the original but with promise support added. This is useful for developers working with older JavaScript packages that haven't been updated to support promises. For example, if you're using a library from a few years ago that relies entirely on callbacks, wrapping it with this tool lets you write await-style code instead of nesting callback after callback. It can also handle individual functions, not just whole modules. The tool gives you some control over what gets converted. You can exclude specific properties from being wrapped, or choose to only convert properties that belong directly to the object rather than inherited ones. The README doesn't go into detail on specific performance tradeoffs, but the Proxy-based approach means the wrapper dynamically intercepts property access rather than creating a static copy.
A small JavaScript utility that converts old callback-style functions into modern promise-based ones so you can use await instead of nesting callbacks.
Mainly JavaScript. The stack also includes JavaScript, Node.js.
Dormant — no commits in 2+ years (last push 2020-07-21).
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.