Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

exit-then

thenables12MIT1.4.0

Execute promises before exiting a process

exit, sigint, sigterm, cleanup, process

readme

exit-then

NPM version Dependency Status License Downloads Gittip

Execute promises before exiting a process. Useful for cleaning up a process right before it quits.

API

var fns = require('exit-then');

fns.push(function () {
  return new Promise(function (resolve) {
    doSomethingAsync(function () {
      resolve();
    });
  });
});