Skip to content
Discussion options

You must be logged in to vote

Solution: use before exit

process.on('beforeExit', async () => {
    await something()
    process.exit(0) // if you don't close yourself this will run forever
});

Replies: 0 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@fzn0x
Comment options

Answer selected by fzn0x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant