S
S
Stepan2020-01-15 13:12:03
Node.js
Stepan, 2020-01-15 13:12:03

How to catch the completion of the script?

How to catch the script completion event? That is, when I press ctrl + c in the console, the script ends, but can I catch this event?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Suntsev, 2020-01-15
@Stepashka20

process.on('exit', (code) => {
  console.log(`About to exit with code: ${code}`);
});

doka

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question