Loading topic
package.json and a minimal tsconfig.json, and compile and run a one-line program. When that works, you have a toolchain you can trust, and later problems will be in your code, no6 min readtsconfig.json for the wcl tool so that tsc produces ES module JavaScript that Node.js runs without a bundler or loader.6 min readsrc/cli.ts for the wcl tool and covers the choices that keep it small and reliable.7 min readwcl into structured values. It uses the built-in node:util function parseArgs. It assumes you have a project that compiles TypeScript to Node.js ESM and an entry file with a shebang line. It also assumes you know what `process.arg6 min readparseArgs call from the previous chapter and that you know TypeScript unions and try/catch. It covers how to turn raw command-line text into input the rest of the program can trust.5 min readwcl project from the earlier chapters: a TypeScript project in ESM mode with strict enabled, and an entry point that reads process.argv through util.parseArgs. You should be comfortable with union types and switch statements. Everything here is plain TypeS6 min readwcl should use each one, how to write to them correctly in Node.js, and which problems appear when output is piped or redirected.6 min readwcl that touches the disk. You will read a file with readFile from node:fs/promises, turn low-level failures into readable messages, and read several files without blocking. It assumes you have finished the earlier chapters. That means a project with `"type": "mod6 min readwcl tool reports failure. It explains what a failure looks like to the shell, how to catch errors in Node.js without hiding them, and how to set the process exit code safely. It assumes you have the project from the earlier chapters: parseArgs for arguments, `countTex6 min readwcl tool into a pure counting module and a thin entry file. It assumes you have the project from the earlier chapters: a tsconfig.json using NodeNext, a package.json with "type": "module", and a src/cli.ts that reads a file and prints counts. You should be comfort6 min readwcl project from the earlier chapters: a tsconfig.json that compiles src to dist, a pure countText function in src/count.ts, and a main function in src/cli.ts that returns an exit code. You should know async/await and be comfortable running npm6 min readdist/cli.js into a command named wcl that you can run from any directory. It assumes you have the project from the earlier chapters: a TypeScript source tree in src, a tsconfig.json that emits to dist, and a src/cli.ts entry file that starts with a shebang6 min readwcl project with countText in src/count.ts, an entry point in src/cli.ts that reads a file, and a tsconfig.json using NodeNext. You should also be comfortable with async/await and know what a shell pipe is.5 min read