assert-async

Throw an exception if your callback is called synchronously

Usage no npm install needed!

<script type="module">
  import assertAsync from 'https://cdn.skypack.dev/assert-async';
</script>

README

assert-async

Build Status Coverage Status

Throws an exception if your callback is called synchronusly by a function. The intention is to catch coding errors during development and testing, helping you avoid starving the event queue.

Usage

'use strict';

var assertAsync = require('assert-async');

var internalAsyncLibrary = require('./lib/foo');

assertAsync(internalAsyncLibrary, function (err, res) {
    // ...
});

Installation

npm install assert-async --save

License

MIT