Node.js + Express + TypeScript
Express server with TypeScript
Primary commands
bash
npx scafix create express
npx scafix create express --pattern rest --cors --helmet --package-manager pnpm
npx scafix create express --no-typescript --no-eslint --prettier --no-dotenvSupported customizations
| Option | CLI flags | Type / values | Default | Notes |
|---|---|---|---|---|
| TypeScript | --typescript--no-typescript | boolean | true | Choose TypeScript or JavaScript output. |
| Architecture pattern | --pattern <pattern> | mvc MVCrest REST APIlayered Layeredsimple Simple | mvc | Select the generated application structure. |
| ESLint | --eslint--no-eslint | boolean | true | Adds ESLint configuration to the generated API. |
| Prettier | --prettier--no-prettier | boolean | false | Adds Prettier configuration to the generated API. |
| CORS | --cors--no-cors | boolean | false | Adds CORS middleware support. |
| Helmet | --helmet--no-helmet | boolean | false | Adds Helmet security headers middleware. |
| dotenv | --dotenv--no-dotenv | boolean | true | Adds .env loading support. |
--yes defaults
| Key | value |
|---|---|
| typescript | true |
| pattern | mvc |
| eslint | true |
| prettier | false |
| cors | false |
| helmet | false |
| dotenv | true |
Notes
- Express requires an npm-safe package name, not just a generic project name.
Shared flow reminder
- Shared flags such as
--name,--directory,--package-manager,--git, and--debugapply here as well. - If required values are omitted and a TTY is available, Scafix prompts for them before calling the stack adapter.
- See CLI Reference for the shared command surface used by
scafix.
