A minimal setup for developing Node.js applications using TypeScript. This boilerplate includes basic configurations for TypeScript, environment variables, and automatic reloading during development.
- 🌟 TypeScript: Strongly typed JavaScript for safer code.
- 🔄 Nodemon: Automatically restarts the server on file changes.
- 🌱 dotenv: Loads environment variables from a
.env
file. - 📦 ES2022 Support: Utilizes modern JavaScript features.
- Node.js (v14 or later)
- npm or yarn
Clone
the repository:
git clone https://github.com/d3xt3r9/boilerplate-node-typescript.git
cd boilerplate-node-typescript
Install
dependencies:
npm install
- Create a
.env
file in the root directory and set your environment variables:
MESSAGE=Welcome to my Node.js + TypeScript setup!
- Development:
Start
the server with automatic reloading.
npm run dev
- Build:
Compile
TypeScript to JavaScript.
npm run build
- Start:
Run
the compiled JavaScript files.
npm start