Skip to content

Best exit for this case #4927

Answered by fzn0x
fzn0x asked this question in Q&A
Apr 29, 2022 · 0 comments · 2 replies
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