A command-line tool to quickly scaffold an Express application skeleton pre-configured with TypeScript, modern tooling, and optional stylesheet or view engine support.
Inspired by express-generator.
- TypeScript Native: Pre-configured
tsconfig.json, source files insrc/, and ES Modules imports. - Modern Dev Tooling: Live reloading using nodemon and ts-node for seamless TypeScript execution.
- Environment Configuration: Ready-to-go dotenv configuration.
- Cross-Platform Static Building: Multi-platform node script for copying public assets & templates to
distfor compilation. - Multiple Options: Supports CSS preprocessors (Sass, Less) and popular view engines (EJS, Pug, Handlebars).
- Git Ready: Built-in option to initialize git repository and generate
.gitignore.
The package is published on npm as @veton.milaimi/express-ts-generator and exposes the express-ts command.
Install it globally:
npm install -g @veton.milaimi/express-ts-generatorThen generate a project:
express-ts [options] [dir]You can also run it without installing globally:
npx @veton.milaimi/express-ts-generator [options] [dir]After global installation, use the CLI command:
express-ts [options] [dir]For one-off usage, prefix the same arguments with the package name:
npx @veton.milaimi/express-ts-generator [options] [dir]Examples:
# Generate an API project in ./my-app
express-ts --git --pm npm my-app
# Or run directly from npm without a global install
npx @veton.milaimi/express-ts-generator --ejs --css sass my-web-app| Flag | Option | Description |
|---|---|---|
-h |
--help |
Output usage information |
--version |
Output the version number | |
-e |
--ejs |
Add EJS engine support |
--pug |
Add Pug engine support | |
--hbs |
Add Handlebars engine support | |
--no-view |
Use static HTML instead of a view engine (default) | |
-c |
--css <engine> |
Add stylesheet engine support (css, sass, less) (default: css) |
-g |
--git |
Add .gitignore and initialize a git repository |
-f |
--force |
Force generation in a non-empty directory |
-p |
--pm <manager> |
Specify package manager: npm, yarn, pnpm, bun (default: npm) |
npx @veton.milaimi/express-ts-generator --git --pm npm my-appcd my-app
npm install
npm run devnpx @veton.milaimi/express-ts-generator --ejs --css sass my-web-appInside the generated project directory, you will have access to the following npm scripts:
- Start development server (with hot-reloading):
npm run dev
- Build the project (compiles TypeScript to
dist/and copies static assets):npm run build
- Start the compiled application in production mode:
npm start
MIT