pre-exit
v1.0.0
Published
A utility package which allows you to clean up before node exits
Downloads
27
Maintainers
Readme
pre-exit
Clean up before you exit.
Installing
# npm
npm install -s pre-exit
# yarn
yarn add pre-exit
Usage
This package will listen on
import preExit from 'pre-exit'
// If there's an HTTP(S) server listening (assume that's `httpServer`)
// then you probably want to close it down gracefully before shutting down the server
cleanup(function closeServer() {
return new Promise(resolve => {
httpServer.close(resolve)
})
})