Skip to content

Latest commit

 

History

History
58 lines (44 loc) · 3.15 KB

README.md

File metadata and controls

58 lines (44 loc) · 3.15 KB

TypeScript | Node.js Bootstrap (template)

This repository is intended to serve as a starting point if you want to bootstrap a quick TypeScript project, a basic local playground.

⚠️ It is meant for simple use cases where you don't need the extra complexity, just a barebones, simple Node.js app and the Node REPL isn't enough.

This has its shortcomings:

  • No proper DI framework/container/tool
  • No Clean Architecture structuring (I strongly suggest a Hexagonal Architecture + DDD approach)
    • Coupling of infrastructure and application layers unless you separate them yourself

If these issues don't matter for your intended use, or you know how to fix them, this will be a fast way to run a quick script or program.

If you're looking for a more scalable strategy, check out my friend @AlexHHPS and I's TypeScript DDD template or if you want a simple API, check out my TypeScript API Template


Features

Local dev

You'll need to duplicate the .env.example file and rename it to .env and to .env.test first.

Action Command Description
Install dependencies pnpm i Installs the necessary dependencies
Compile pnpm build Transpiles TS into JS
Run pnpm start Runs the compiled JS
Dev pnpm dev Runs the TypeScript code and watches for changes

Testing (Node Test Runner)

Action Command Description
Test pnpm test Runs all the tests

Formatting (Biome)

Action Command Description
Format pnpm format Ensures code follows style guides
Lint pnpm lint Runs the linter and points out mistakes