# cbw

> callback wrapper

Latest version **1.5.0** (published 2025-11-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install cbw
pnpm add cbw
yarn add cbw
bun add cbw
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 1.5.0 |
| Published | 2025-11-05 |
| First published | 2015-03-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ^24 |
| Dependencies | 0 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dmitry Shirokov |
| Maintainers | runk, alexandria |
| Keywords | callback, wrapper, err |

## Links

- npm: https://www.npmjs.com/package/cbw
- Repository: https://github.com/Adslot/node-cbw
- Homepage: https://github.com/Adslot/node-cbw#readme
- Issues: https://github.com/Adslot/node-cbw/issues
- npm.io page: https://npm.io/package/cbw

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 1.5.0 (latest) — 2025-11-05
- 1.4.1 — 2025-02-06
- 1.4.0 — 2024-11-27
- 1.3.1 — 2024-01-12
- 1.3.0 — 2023-10-25
- 1.2.0 — 2022-10-27
- 1.1.0 — 2021-11-04
- 1.0.1 — 2021-03-31
- 1.0.0 — 2020-07-21
- 0.0.7 — 2020-07-21
- 0.0.6 — 2020-05-11
- 0.0.5 — 2020-05-08
- 0.0.4 — 2020-05-08
- 0.0.1 — 2015-03-17

## README

cbw
========

[![npm version](https://badge.fury.io/js/cbw.svg)](https://badge.fury.io/js/cbw)
![Build Status](https://github.com/Adslot/node-cbw/actions/workflows/node.js.yml/badge.svg)

Callback wrapper for cleaner async code. Main benefit is you don't need to write `if (err) return cb(err)`.


## Usage


```javascript
var cbw = require('cbw');

var doSomething = function(cb) {
  getUsers(cbw(cb)(function(users) {
    getArticles(cbw(cb)(function(articles) {
      cb(null, [users, articles]);
    }));
  }));
};

```

## License

MIT

---
_Source: https://npm.io/package/cbw · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
