A modern TypeScript project template with comprehensive tooling for Node.js development.
- 🚀 TypeScript 5.9+ with modern ES modules
- 🧪 Jest testing framework with ESM support
- 🔍 ESLint with TypeScript and Prettier integration
- 🎨 Prettier code formatting
- 📦 Composite TypeScript configuration for better build performance
- 🏗️ VS Code tasks for building, watching, and linting
- 📊 Code coverage reporting
- 🔄 Watch mode for development
-
Create a new repository from this template
- Click the "Use this template" button on GitHub
- Or visit:
https://github.com/justin/jww-typescript-template/generate
- Name your new repository and clone it
-
Set up your new project
cd your-new-project npm install
-
Customize your project
# Update package.json with your project details npm pkg set name="your-project-name" npm pkg set description="Your project description" npm pkg set author="Your Name"
-
Start developing
npm run watch # Start TypeScript compiler in watch mode
├── src/ # TypeScript source files
│ └── index.ts # Main entry point
├── __tests__/ # Jest test files
│ └── index.test.ts # Example test
├── lib/ # Compiled JavaScript output
├── coverage/ # Test coverage reports
├── tsconfig.json # Main TypeScript config
├── tsconfig.base.json # Base TypeScript config
├── tsconfig.test.json # Test-specific TypeScript config
├── jest.config.ts # Jest configuration
└── package.json # Project dependencies and scripts
npm run build
- Compile TypeScript to JavaScriptnpm run watch
- Watch mode compilationnpm start
- Run the compiled JavaScript
npm test
- Run all testsnpm run test-watch
- Run tests in watch mode
npm run lint
- Run ESLintnpm run lint-fix
- Run ESLint with auto-fixnpm run format
- Format code with Prettiernpm run format-check
- Check code formatting
npm run clean
- Clean workspace and reinstall dependenciesnpm run package
- Build and create npm package
This template uses a composite TypeScript setup:
tsconfig.base.json
- Base configuration with modern settingstsconfig.json
- Main build configuration (src → lib)tsconfig.test.json
- Test-specific configuration
- ES modules with
nodenext
module resolution - Strict type checking enabled
- Declaration files and source maps generated
- Composite builds for faster incremental compilation
Configured for TypeScript and ES modules:
- Uses
ts-jest
with ESM preset - Tests located in
__tests__/
directory - Coverage reports generated in
coverage/
- Supports modern TypeScript features
- TypeScript-aware linting rules
- Prettier integration for consistent formatting
- TSDoc plugin for documentation comments
- Automatic code formatting
- Integrated with ESLint to avoid conflicts
- Formats TypeScript files in
src/
and__tests__/
Pre-configured tasks available in VS Code:
- Build TypeScript Files (Ctrl+Shift+B)
- Watch TypeScript Files
- Run ESLint
- Clean Workspace
-
Write your code
- Add your TypeScript files to
src/
- Export your main functionality from
src/index.ts
- Add your TypeScript files to
-
Add tests
- Create test files in
__tests__/
- Follow the naming pattern
*.test.ts
- Create test files in
-
Build and run
npm run build npm start
If you're contributing to or maintaining this template:
-
Clone the template repository
git clone https://github.com/justin/jww-typescript-template.git cd jww-typescript-template
-
Install dependencies
npm install
-
Make your changes and test
npm run watch # Start TypeScript compiler in watch mode npm test # Run tests
# Runtime dependencies
npm install <package-name>
# Development dependencies
npm install -D <package-name>
Edit tsconfig.base.json
for project-wide settings, or individual config files for specific use cases.
Modify jest.config.ts
to adjust test settings, add setup files, or configure coverage thresholds.
MIT - See LICENSE file for details