create-ts-express-app 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Readme.md CHANGED
@@ -1,97 +1,98 @@
1
- # TypeScript Node.js Backend Template
1
+ # TypeScript Express Backend Starter
2
2
 
3
- A clean, production-ready TypeScript backend template for Node.js applications with modern best practices.
3
+ A clean, production-ready **TypeScript + Node.js** backend boilerplate built with modern best practices. Instant Express app generation with `npx`.
4
4
 
5
- ## Features
5
+ ---
6
6
 
7
- - TypeScript configuration optimized for backend development
8
- - ✅ Express.js web server
9
- - ✅ Environment variable management with dotenv
10
- - ✅ Development mode with hot reloading
11
- - ✅ Proper project structure for scalability
12
- - ✅ Error handling middleware
13
- - ✅ NPM scripts for development and production
7
+ ## 🚀 Quickstart
14
8
 
15
- ## Getting Started
9
+ ```bash
10
+ npx create-ts-express-app@latest my-project-name
11
+ cd my-project-name
12
+ npm install
13
+ npm run dev
14
+ ```
16
15
 
17
- ### Prerequisites
16
+ You're up and running in seconds. Just ship.
18
17
 
19
- - Node.js 18.x or higher
20
- - npm or yarn
18
+ ---
21
19
 
22
- ### Installation
20
+ ## 🧰 Features
23
21
 
24
- 1. Clone this repository:
22
+ - ⚙️ Fully typed Express.js setup
23
+ - 🔄 Hot reloading with `ts-node-dev`
24
+ - 🔐 `.env`-based configuration
25
+ - ✅ Clean file structure built to scale
26
+ - 🧱 Error handling middleware
27
+ - 🛠️ Scripts for dev & prod workflows
25
28
 
26
- ```bash
27
- git clone https://github.com/harsh-dev0/ts-express.git
28
- cd ts-express
29
- ```
29
+ ---
30
30
 
31
- 2. Install dependencies:
31
+ ## 📦 Prerequisites
32
32
 
33
- ```bash
34
- npm install
35
- ```
33
+ - Node.js **18+**
34
+ - `npm` or `yarn`
36
35
 
37
- 3. Create a `.env` file in the root directory:
36
+ ---
38
37
 
39
- ```
40
- PORT=3000
41
- ```
38
+ ## 🧪 Development
42
39
 
43
- ### Development
44
-
45
- Start the development server with hot reloading:
40
+ Start dev server with hot reloading:
46
41
 
47
42
  ```bash
48
43
  npm run dev
49
44
  ```
50
45
 
51
- For watching file changes:
46
+ Or watch all file changes:
52
47
 
53
48
  ```bash
54
49
  npm run dev:watch
55
50
  ```
56
51
 
57
- ### Production
58
-
59
- Build the project:
52
+ ---
60
53
 
61
- ```bash
62
- npm run build
63
- ```
54
+ ## 🚢 Production
64
55
 
65
- Start the production server:
56
+ Build & run:
66
57
 
67
58
  ```bash
59
+ npm run build
68
60
  npm start
69
61
  ```
70
62
 
71
- ## Project Structure
63
+ ---
64
+
65
+ ## 🌳 Project Structure
72
66
 
73
67
  ```
74
- ts-express/
75
- ├── src/ # Source code
76
- │ ├── index.ts # Application entry point
77
- │ ├── routes/ # API routes
78
- │ ├── controllers/ # Route controllers
79
- │ ├── models/ # Data models
80
- ├── middleware/ # Express middleware
81
- │ └── config/ # Configuration files
82
- ├── dist/ # Compiled output (generated)
83
- ├── tsconfig.json # TypeScript configuration
84
- ├── package.json # Project dependencies
85
- └── .env # Environment variables
68
+ my-project/
69
+ ├── src/
70
+ │ ├── index.ts # App entry
71
+ │ ├── routes/ # Routes
72
+ │ ├── controllers/ # Route logic
73
+ │ ├── middleware/ # Custom middleware
74
+ └── config/ # Config (env, db, etc.)
75
+ ├── dist/ # Compiled JS (auto-generated)
76
+ ├── .env # Environment variables
77
+ ├── package.json
78
+ └── tsconfig.json
86
79
  ```
87
80
 
88
- ## Scripts
81
+ ---
82
+
83
+ ## 🎯 Scripts
84
+
85
+ | Command | Description |
86
+ |---------------------|-------------------------------------|
87
+ | `npm run dev` | Start dev server (hot reload) |
88
+ | `npm run dev:watch` | Dev with full file watching |
89
+ | `npm run build` | Compile TypeScript to JavaScript |
90
+ | `npm start` | Start production server |
91
+
92
+ ---
89
93
 
90
- - `npm run build` - Compiles TypeScript to JavaScript
91
- - `npm start` - Starts the production server
92
- - `npm run dev` - Starts the development server
93
- - `npm run dev:watch` - Starts the development server with file watching
94
+ ## 📄 License
94
95
 
95
- ## License
96
+ MIT — Use it. Build with it. Ship something great.
96
97
 
97
- MIT
98
+ ---
package/bin/cli.js CHANGED
@@ -41,8 +41,18 @@ async function createProject() {
41
41
  try {
42
42
  await fs.copy(templateDir, targetDir);
43
43
  console.log('Template files copied successfully.');
44
-
45
- // Update package.json with project name
44
+ // Add this after copying the template files:
45
+ await fs.writeFile(
46
+ path.join(targetDir, '.gitignore'),
47
+ `# Generated .gitignore file
48
+ node_modules/
49
+ dist/
50
+ .env
51
+ .DS_Store
52
+ npm-debug.log
53
+ yarn-error.log
54
+ `
55
+ )
46
56
  const packageJsonPath = path.join(targetDir, 'package.json');
47
57
  if (fs.existsSync(packageJsonPath)) {
48
58
  const packageJson = await fs.readJson(packageJsonPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ts-express-app",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "main": "index.js",
5
5
  "bin": {
6
6
  "create-ts-express-app": "bin/cli.js"
@@ -1,97 +1,98 @@
1
- # TypeScript Node.js Backend Template
1
+ # TypeScript Express Backend Starter
2
2
 
3
- A clean, production-ready TypeScript backend template for Node.js applications with modern best practices.
3
+ A clean, production-ready **TypeScript + Node.js** backend boilerplate built with modern best practices. Instant Express app generation with `npx`.
4
4
 
5
- ## Features
5
+ ---
6
6
 
7
- - TypeScript configuration optimized for backend development
8
- - ✅ Express.js web server
9
- - ✅ Environment variable management with dotenv
10
- - ✅ Development mode with hot reloading
11
- - ✅ Proper project structure for scalability
12
- - ✅ Error handling middleware
13
- - ✅ NPM scripts for development and production
7
+ ## 🚀 Quickstart
14
8
 
15
- ## Getting Started
9
+ ```bash
10
+ npx create-ts-express-app@latest my-project-name
11
+ cd my-project-name
12
+ npm install
13
+ npm run dev
14
+ ```
16
15
 
17
- ### Prerequisites
16
+ You're up and running in seconds. Just ship.
18
17
 
19
- - Node.js 18.x or higher
20
- - npm or yarn
18
+ ---
21
19
 
22
- ### Installation
20
+ ## 🧰 Features
23
21
 
24
- 1. Clone this repository:
22
+ - ⚙️ Fully typed Express.js setup
23
+ - 🔄 Hot reloading with `ts-node-dev`
24
+ - 🔐 `.env`-based configuration
25
+ - ✅ Clean file structure built to scale
26
+ - 🧱 Error handling middleware
27
+ - 🛠️ Scripts for dev & prod workflows
25
28
 
26
- ```bash
27
- git clone https://github.com/harsh-dev0/ts-express.git
28
- cd ts-express
29
- ```
29
+ ---
30
30
 
31
- 2. Install dependencies:
31
+ ## 📦 Prerequisites
32
32
 
33
- ```bash
34
- npm install
35
- ```
33
+ - Node.js **18+**
34
+ - `npm` or `yarn`
36
35
 
37
- 3. Create a `.env` file in the root directory:
36
+ ---
38
37
 
39
- ```
40
- PORT=3000
41
- ```
38
+ ## 🧪 Development
42
39
 
43
- ### Development
44
-
45
- Start the development server with hot reloading:
40
+ Start dev server with hot reloading:
46
41
 
47
42
  ```bash
48
43
  npm run dev
49
44
  ```
50
45
 
51
- For watching file changes:
46
+ Or watch all file changes:
52
47
 
53
48
  ```bash
54
49
  npm run dev:watch
55
50
  ```
56
51
 
57
- ### Production
58
-
59
- Build the project:
52
+ ---
60
53
 
61
- ```bash
62
- npm run build
63
- ```
54
+ ## 🚢 Production
64
55
 
65
- Start the production server:
56
+ Build & run:
66
57
 
67
58
  ```bash
59
+ npm run build
68
60
  npm start
69
61
  ```
70
62
 
71
- ## Project Structure
63
+ ---
64
+
65
+ ## 🌳 Project Structure
72
66
 
73
67
  ```
74
- ts-express/
75
- ├── src/ # Source code
76
- │ ├── index.ts # Application entry point
77
- │ ├── routes/ # API routes
78
- │ ├── controllers/ # Route controllers
79
- │ ├── models/ # Data models
80
- ├── middleware/ # Express middleware
81
- │ └── config/ # Configuration files
82
- ├── dist/ # Compiled output (generated)
83
- ├── tsconfig.json # TypeScript configuration
84
- ├── package.json # Project dependencies
85
- └── .env # Environment variables
68
+ my-project/
69
+ ├── src/
70
+ │ ├── index.ts # App entry
71
+ │ ├── routes/ # Routes
72
+ │ ├── controllers/ # Route logic
73
+ │ ├── middleware/ # Custom middleware
74
+ └── config/ # Config (env, db, etc.)
75
+ ├── dist/ # Compiled JS (auto-generated)
76
+ ├── .env # Environment variables
77
+ ├── package.json
78
+ └── tsconfig.json
86
79
  ```
87
80
 
88
- ## Scripts
81
+ ---
82
+
83
+ ## 🎯 Scripts
84
+
85
+ | Command | Description |
86
+ |---------------------|-------------------------------------|
87
+ | `npm run dev` | Start dev server (hot reload) |
88
+ | `npm run dev:watch` | Dev with full file watching |
89
+ | `npm run build` | Compile TypeScript to JavaScript |
90
+ | `npm start` | Start production server |
91
+
92
+ ---
89
93
 
90
- - `npm run build` - Compiles TypeScript to JavaScript
91
- - `npm start` - Starts the production server
92
- - `npm run dev` - Starts the development server
93
- - `npm run dev:watch` - Starts the development server with file watching
94
+ ## 📄 License
94
95
 
95
- ## License
96
+ MIT — Use it. Build with it. Ship something great.
96
97
 
97
- MIT
98
+ ---
@@ -1,10 +1,7 @@
1
1
  {
2
2
  "name": "create-ts-express-kit",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "main": "index.js",
5
- "bin": {
6
- "create-ts-express-kit": "./create.js"
7
- },
8
5
  "scripts": {
9
6
  "build": "tsc",
10
7
  "start": "node dist/index.js",
@@ -30,8 +27,7 @@
30
27
  "dependencies": {
31
28
  "@types/express": "^5.0.1",
32
29
  "dotenv": "^16.5.0",
33
- "express": "^5.1.0",
34
- "ncp": "^2.0.0"
30
+ "express": "^5.1.0"
35
31
  },
36
32
  "repository": {
37
33
  "type": "git",