# conform-async

> Calls callbacks on next tick so you can avoid craziness from code that expects async to not execute immediately.

Latest version **1.1.1** (published 2014-12-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install conform-async
pnpm add conform-async
yarn add conform-async
bun add conform-async
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2014-12-21 |
| First published | 2014-12-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jim Kang |
| Maintainers | jimkang |
| Keywords | async, sync, callback, nexttick |

## Links

- npm: https://www.npmjs.com/package/conform-async
- Repository: git@github.com:jimkang/conform-async
- Homepage: https://github.com/jimkang/conform-async
- Issues: https://github.com/jimkang/conform-async/issues
- npm.io page: https://npm.io/package/conform-async

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 1.1.1 (latest) — 2014-12-21
- 1.1.0 — 2014-12-21
- 1.0.0 — 2014-12-20

## README

conform-async
=============

A handy wrapper for `process.nextTick` that you can use to call a callback on the next tick instead of immediate, even though you have the results for callback. [Here's why you'd want to do this](http://nodejs.org/api/process.html#process_process_nexttick_callback) (scroll to "It is very important...").

Installation
------------

    npm install conform-async

Usage
-----
    var conformAsync = require('conform-async');

    // callback expects to be called async.
    function getResultForSpecialSituation(id, callback) {
    	var error = null;
    	var constantResult = 'This is always the result';
			conformAsync.callBackOnNextTick(callback, error, constantResult);
		}

So, here's the implementation:

		function makeCallbackCaller(cb, error, result) {
			return function callbackCall() {
				cb(error, result);
			};
		}

		function callBackOnNextTick(cb, error, result) {
			process.nextTick(makeCallbackCaller(cb, error, result));
		}

It's not much. It's just something I don't want to copy from project to project. :) (`makeCallbackCaller` is exposed in case you want to use make a callback wrapper and pass it to `setTimeout` or something instead of `process.nextTick`.)

Tests
-----

Run tests with `make test`.

License
-------

MIT.

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