New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

node-typescript-gen

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-typescript-gen

CLI tool to create Express applications written in Typescript!

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

node-typescript-gen

A CLI tool to quickly create Express TypeScript applications by pulling from the official template repository and customizing it for your needs.

Features

  • 🚀 Quick project setup with interactive prompts
  • 📁 Well-organized project structure
  • 🔧 Pre-configured with essential middleware and utilities
  • 📝 TypeScript support out of the box
  • 🛡️ Built-in security features (rate limiting, XSS protection)
  • 📊 Logging with Winston
  • 🔄 Hot reload for development
  • 🎯 Dependency injection container
  • ⚡ Error handling middleware

Installation

Global Installation

npm install -g node-typescript-gen

Local Usage (npx)

npx node-typescript-gen my-app

Usage

Basic Usage

node-typescript-gen my-app

This will prompt you for:

  • Project name (defaults to the provided name)
  • Project description
  • Author name
  • Version number
  • Whether to install dependencies automatically

Using Custom Templates

You can specify a custom template repository URL:

node-typescript-gen my-app --template https://github.com/yourusername/your-template.git

Interactive Mode

If you don't provide a project name, the CLI will guide you through all options:

node-typescript-gen

How It Works

The CLI pulls the latest template from the official express-typescript-template repository, removes unnecessary files (LICENSE, .env.example, etc.), and customizes it for your project.

What Gets Created

The CLI creates a complete Express TypeScript application with the following structure:

my-app/
├── src/
│   ├── app.factory.ts      # Application factory
│   ├── config/            # Configuration files
│   │   ├── app.config.ts
│   │   └── database.config.ts
│   ├── container/         # Dependency injection container
│   │   └── di.container.ts
│   ├── lib/              # Utility libraries
│   │   ├── app-assert.ts
│   │   ├── async-handler.ts
│   │   ├── custom-error.ts
│   │   └── rate-limit.ts
│   ├── logger/           # Logging configuration
│   │   ├── logger.config.ts
│   │   └── logger.service.ts
│   ├── middleware/       # Express middleware
│   │   ├── error-handler.ts
│   │   ├── morgan-middleware.ts
│   │   └── service-protection.ts
│   ├── types/           # TypeScript type definitions
│   │   ├── database.types.ts
│   │   └── protection.types.ts
│   └── server.ts        # Server entry point
├── .env                 # Environment variables
├── package.json         # Project configuration
├── tsconfig.json        # TypeScript configuration
└── README.md           # Project documentation

Included Features

Core Features

  • Express.js with TypeScript
  • Dependency Injection container for better code organization
  • Error Handling middleware with custom error classes
  • Rate Limiting to protect your API
  • Logging with Winston for production-ready logging
  • CORS support for cross-origin requests
  • XSS Protection middleware
  • Environment Configuration with dotenv

Development Features

  • Hot Reload with tsc-watch
  • TypeScript configuration optimized for Node.js
  • Prettier for code formatting
  • Module Aliases for clean imports

Production Features

  • Build Process with TypeScript compilation
  • Production Server configuration
  • Error Handling for production environments
  • Security Middleware enabled by default

Getting Started

After creating your project:

cd my-app
npm install
npm run dev

Your server will start on http://localhost:3000

Demo

You can run a demo to see the generator in action:

npm run demo

This will create a sample project called demo-express-app to demonstrate the functionality.

Available Scripts

  • npm run dev - Start development server with hot reload
  • npm run build - Build the project for production
  • npm start - Start production server
  • npm run format - Format code with Prettier

Configuration

The generated project includes several configuration files:

  • app.config.ts - Application configuration
  • database.config.ts - Database configuration (ready for your database)
  • logger.config.ts - Logging configuration
  • .env - Environment variables

Contributing

  • Fork the repository
  • Create your feature branch (git checkout -b feature/amazing-feature)
  • Commit your changes (git commit -m 'Add some amazing feature')
  • Push to the branch (git push origin feature/amazing-feature)
  • Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you encounter any issues or have questions, please open an issue on GitHub.

Keywords

express

FAQs

Package last updated on 11 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts