o-az / template-ts

Node.js TypeScript template for libraries

Repository from Github https://github.como-az/template-tsRepository from Github https://github.como-az/template-ts

NOTE: You are welcome to ask any questions if anything is unclear. Also feel free to post a discussion

TypeScript / Node.js Template

Requires Node.js LTS (v20 or later) and pnpm v8 or higher


Stack

  • TypeScript
  • pnpm package manager
  • vitest test runner
  • CommonJS and ESM support
  • Biome for linting and formatting
  • CI with GitHub Actions
  • Publish to npm registry, GitHub Packages, Docker Hub and GitHub Container Registry with pnpm (see publish.yml)

- VSCode ready (see .vscode)


Getting started

Clone repository

git clone https://github.com/o-az/template-ts.git && cd template-ts

Install dependencies

pnpm install

Copy .env.example to .env and modify as needed

cp .env.example .env

Run development server

pnpm dev

run tests

pnpm test

run build and start production server

pnpm build && pnpm start

to run a one-off TypeScript file

node --import=tsx path/to/file.ts

Publish Package

This will trigger publish workflow in GitHub Actions

pnpm release

select version, it will create git tags and push to remote

Lastly, you should modify the workflows in .github/workflows to suit your needs

About

Node.js TypeScript template for libraries

License:MIT License


Languages

Language:TypeScript 82.3%Language:Dockerfile 17.7%