loaded-bases

Give diagnostics on double callbacks

Usage no npm install needed!

<script type="module">
  import loadedBases from 'https://cdn.skypack.dev/loaded-bases';
</script>

README

loaded-bases

A module to diagnose double callbacks

Use

var lb = require('loaded-bases');

functionToDiagnose('arg', lb(function(err, result) {
    // Will only be called once, and a warning will be emitted if something tries to call it again. Stacks will be included.
}));

functionToDiagnose('arg', lb(function(err, result) {
    // Will only be called once
}, function (last, now) {
    // last is the stack of the first call, now is the stack of the second call
});