# Arguments, Exit Codes and Clear Errors

A command-line tool reads the words typed after it with process.argv and util.parseArgs, prints a --help line, sends errors to console.error with a message a person can act on, and sets process.exitCode so the computer that ran it knows whether it worked.

![Cheat sheet: Arguments, Exit Codes and Clear Errors](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/59ab235e41bd4aa49234431c4e01c064.webp)

- Category: Node.js
- Level: Apprentice
- Tags: Exit Code (operating-system), flags-and-options, JavaScript, nodejs, process.argv, util.parseArgs
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/node-command-line-arguments-cheat-sheet
