The global `process` object exposes the running program: `process.argv` (CLI arguments), `process.env` (environment variables), `process.exit(code)`, and `process.on("SIGINT", ...)` for signal handling.
js
const rpcUrl = process.env.RPC_URL ?? "https://mainnet.base.org";
const [, , command] = process.argv; // argv[0]=node, argv[1]=script path
process.on("SIGINT", () => {
console.log("shutting down gracefully");
process.exit(0);
});Configuration (API keys, RPC endpoints, database URLs) should live in environment variables, not hard-coded in source — this is how the same code runs against testnet and mainnet, and it keeps secrets out of git history.