Choose TypeScript, Go, Rust or C++ and find syntax, everyday APIs, standard libraries and tools in one place.
Scope and conventions
TypeScript/Node, Go 1.23+, Rust 2024 and C++23: from a first CLI to files, JSON, HTTP, concurrency and testing. Complete programs are labeled; other examples identify their surrounding code/imports. Optional libraries and version requirements are named in each entry.
Create a Node/TypeScript project with an explicit compiler configuration. Save the complete CLI example below as main.ts before compiling. Commands run in a new empty folder.
Fragment
Requires Node.js and npm. Browser apps use a browser build/entry point; process is Node-specific.
main.ts
Follow appearance
✓GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
mkdir hello-clicd hello-clinpm init -ynpm install --save-dev typescript @types/nodecat > tsconfig.json <<'JSON'{ "compilerOptions": { "target": "ES2023", "module": "NodeNext", "strict": true, "types": ["node"], "outDir": "out" }, "include": ["main.ts"]}JSON# Save the CLI example as main.ts, then:npx tsc -p tsconfig.jsonnode out/main.js Ada
Environment values are strings. Reject malformed/out-of-range configuration before starting the application.
Fragment
Node program. Empty, missing and malformed values are distinct; this example defaults only when unset.
main.ts
Follow appearance
✓GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
const raw = process.env.PORT ?? "3000";if (!/^[0-9]+$/.test(raw)) throw new Error("Invalid PORT");const port = Number(raw);if (!Number.isSafeInteger(port) || port < 1 || port > 65535) { throw new Error("PORT must be 1..65535");}
tsc checks/emits JavaScript; --noEmit checks only. --noEmitOnError prevents new output on errors. node out/main.js runs that output. Node with built-in type stripping can run erasable TypeScript directly without type-checking.
Fragment
Shell commands run separately; assumes local TypeScript and Node type-stripping support (Node 22.18+).