node.js stop execution code example Example 1: how to terminate a program in js process.exit(1) Example 2: end code nodejs process.exit()