Add exit to quickstart
Created by: eitjuh
Summary
This PR updates the Node.js Quickstart documentation to improve compatibility and clarity for new projects.
Changes
-
Ensured Modern ES Module Support:
Updated the project initialization command to:mkdir wdk-quickstart && cd wdk-quickstart && npm init -y && npm pkg set type=moduleThis ensures
"type": "module"is set inpackage.jsonby default, soimport/exportworks out of the box—avoiding ESM-related Node warnings and keeping the setup step concise. -
Explicit Process Exit Calls:
Addedprocess.exit(0)on success and keptprocess.exit(1)on error in the quickstart’s examplemain()function. This ensures clear script termination and expected process status codes, particularly useful in CI or scripting environments.
Rationale
- Having
"type": "module"set during setup saves users an extra manual step, especially for those new to Node.js ECMAScript Modules. - Explicit termination with
process.exitprevents lingering processes and provides clear success/failure signals.
No breaking changes.
Documentation is now easier to follow and more robust for both manual and automated use.