What is the PHP [die()
]/(http://www.php.net/manual/de/function.die.php) equivalent in Node.js?
https://www.php.net/manual/de/function.exit.php
process.exit()
is the equivalent call.
I would use throw
. Throw will cause the current request at hand to end, and will not terminate the node process. You can catch that output using your error view.
throw new Error('your die message here');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With