How to use the async-exit-hook function in async-exit-hook

To help you get started, we’ve selected a few async-exit-hook examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DevExpress / testcafe / src / utils / temp-directory / index.js View on Github external
async dispose () {
        if (!USED_TEMP_DIRS[this.path])
            return;

        this.lockFile.dispose();

        await cleanupProcess.removeDirectory(this.path);

        delete USED_TEMP_DIRS[this.path];
    }
}

// NOTE: exposed for testing purposes
TempDirectory.TEMP_DIRECTORIES_ROOT = TESTCAFE_TMP_DIRS_ROOT;

setupExitHook(TempDirectory.disposeDirectoriesSync);

async-exit-hook

Run some code when the process exits (supports async hooks and pm2 clustering)

MIT
Latest version published 7 years ago

Package Health Score

67 / 100
Full package analysis