Skip to content

Francesco-Fera/typescript-node-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TypeScript Starter

A minimal TypeScript Node.js scaffold with modern ES modules, strict type checking, and a fast development workflow.

Features

  • TypeScript 5.9 with strict mode enabled
  • ES2022 target with Node.js ES modules (nodenext)
  • Fast development with hot reload via tsx
  • Source maps and type declarations for production
  • Zero runtime dependencies

Requirements

  • Node.js 18.0.0 or higher

Getting Started

# Install dependencies
npm install

# Start development with hot reload
npm run dev

# Build for production
npm run build

# Run production build
npm start

Scripts

Script Description
npm run dev Start development server with hot reload
npm run build Compile TypeScript to JavaScript
npm start Run the compiled application
npm run clean Remove the dist directory

Project Structure

├── src/
│   └── index.ts        # Application entry point
├── dist/               # Compiled output (generated)
├── package.json
├── tsconfig.json
└── .env.example        # Environment variables template

TypeScript Configuration

This scaffold uses a strict TypeScript configuration:

  • Strict mode enabled with additional checks
  • noUncheckedIndexedAccess - Prevents unsafe array/object indexing
  • exactOptionalPropertyTypes - Strict optional property handling
  • verbatimModuleSyntax - Preserves import/export syntax
  • React JSX support - Ready for JSX if needed

Environment Variables

Copy .env.example to .env and configure your environment variables:

cp .env.example .env

Extending the Scaffold

This scaffold is intentionally minimal. Common additions:

  • Linting: Add ESLint with @typescript-eslint
  • Formatting: Add Prettier
  • Testing: Add Vitest or Jest
  • Git hooks: Add Husky with lint-staged

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors