Skip to content

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-dotenv

Supported customizations

OptionCLI flagsType / valuesDefaultNotes
TypeScript--typescript
--no-typescript
booleantrueChoose TypeScript or JavaScript output.
Architecture pattern--pattern <pattern>mvc MVC
rest REST API
layered Layered
simple Simple
mvcSelect the generated application structure.
ESLint--eslint
--no-eslint
booleantrueAdds ESLint configuration to the generated API.
Prettier--prettier
--no-prettier
booleanfalseAdds Prettier configuration to the generated API.
CORS--cors
--no-cors
booleanfalseAdds CORS middleware support.
Helmet--helmet
--no-helmet
booleanfalseAdds Helmet security headers middleware.
dotenv--dotenv
--no-dotenv
booleantrueAdds .env loading support.

--yes defaults

Keyvalue
typescripttrue
patternmvc
eslinttrue
prettierfalse
corsfalse
helmetfalse
dotenvtrue

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 --debug apply 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.

Released under the MIT License.