This is a starter template for a modern Node.js project using TypeScript. It is configured for a streamlined development experience with live-reloading and an optimized build process. The current implementation simply logs a confirmation message to the console upon startup.
- Modern TypeScript: Configured with strict type-checking and modern ECMAScript features (ES2022 target).
- ESM Native: The project is set up as an ES Module.
- Live Reloading: The development server automatically restarts on file changes using
nodemonandtsx. - Optimized Builds: Uses
tsupto bundle the TypeScript source into efficient JavaScript for production.
- Runtime: Node.js
>=21(as specified inpackage.json). - Tools: A Node.js package manager like
npmoryarn.
-
Install dependencies:
npm install
-
Run the development server: This command starts the application with live-reloading.
npm run dev
OR
nodemon
The following scripts are available in package.json:
-
Development (with live-reload):
npm run dev
OR
nodemon
-
One-off Execution:
npm start
-
Production Build: This command compiles and bundles the code into the
dist/directory.npm run build
After building, you can run the production-ready code with Node: node dist/index.js.
To deploy this application:
- Build the project using
npm run build. - Copy the generated
dist/directory and thepackage.jsonfile to your server. - Run
npm install --productionon the server to install only production dependencies. - Start the application using
node dist/index.js.
This project is licensed under the ISC License.