Skip to content

Best exit for this case #42907

Answered by fzn0x
fzn0x asked this question in General
Apr 29, 2022 · 1 comments · 1 reply
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: 1 comment 1 reply

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
Labels
None yet
1 participant