This repository serves as a template for Node.js projects, providing a structured starting point with essential configurations and tools for development, testing, and linting.
- TypeScript: A typed superset of JavaScript that compiles to plain JavaScript.
- ESLint: Linting utility for JavaScript and TypeScript.
- Prettier: Code formatter to ensure consistent style.
- Jest: JavaScript testing framework.
- Husky: Git hooks for automating tasks.
- Lint-staged: Run linters on staged git files.
nodejs-template/
├── .gitignore
├── .prettierignore
├── .prettierrc
├── eslint.config.mjs
├── jest.config.js
├── lint-staged.config.mjs
├── package.json
├── tsconfig.json
├── src/
│ ├── index.ts
│ └── index.test.ts
└── .husky/
└── pre-commit
-
Clone the repository:
git clone https://github.com/baharudin-yusup/nodejs-template.git
-
Navigate to the project directory:
cd nodejs-template
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Run tests:
npm run test
-
Lint the code:
npm run lint
-
Format the code:
npm run format