A modern TypeScript project template with ESLint, Prettier, and automated releases.
npm install npm-kickstart
import { add, multiply, greet } from "npm-kickstart";
console.log(add(2, 3)); // 5
console.log(multiply(4, 5)); // 20
console.log(greet("World")); // Hello, World!
const { add, multiply, greet } = require("npm-kickstart");
console.log(add(2, 3)); // 5
console.log(multiply(4, 5)); // 20
console.log(greet("World")); // Hello, World!
API documentation is automatically generated using TypeDoc and published to GitHub Pages.
# Generate documentation
pnpm run docs
# Clean documentation
pnpm run docs:clean
The generated documentation will be in the docs/ directory. Open docs/index.html in your browser to view it.
When you create a pull request, the documentation preview workflow will automatically:
This allows reviewers to see how your changes affect the API documentation before merging.
This project uses Vitest for unit and end-to-end testing with 100% code coverage.
Unit Tests (.spec.ts): Located alongside source files in src/
src/add/index.spec.ts, src/utils.spec.tsE2E Tests (.test.ts): Located in tests/e2e/
tests/e2e/integration.test.tsTest Utilities: Located in tests/utils/
tests/utils/test-helpers.ts# Run all tests once
pnpm test
# Run tests in watch mode (auto-rerun on changes)
pnpm run test:watch
# Run tests with interactive UI
pnpm run test:ui
# Run tests with coverage report
pnpm run test:coverage
Coverage reports are automatically generated and uploaded to Codecov on every CI run. You can view:
# Install dependencies
pnpm install
# Type check
pnpm run typecheck
# Lint code
pnpm run lint
# Fix linting issues
pnpm run lint:fix
# Format code
pnpm run format
# Check formatting
pnpm run format:check
# Build the project
pnpm run build
# Run tests
pnpm test
# Run tests in watch mode
pnpm run test:watch
# Run tests with UI
pnpm run test:ui
# Run tests with coverage
pnpm run test:coverage
# Generate documentation
pnpm run docs
# Clean build artifacts
pnpm run clean
The project generates multiple build outputs:
Bundled files (dist/bundle/):
index.js - ESM bundle (minified)index.cjs - CommonJS bundle (minified)Native files (dist/esm/ and dist/cjs/):
npm-kickstart/
âââ .github/
â âââ workflows/
â âââ ci.yml # CI workflow with tests
â âââ docs.yml # Documentation publishing
â âââ docs-preview.yml # PR documentation preview
â âââ release.yml # Release and publish workflow
âââ src/
â âââ add/
â â âââ index.ts # Add function
â â âââ index.spec.ts # Unit tests
â âââ sum/
â â âââ index.ts # Sum function
â â âââ index.spec.ts # Unit tests
â âââ index.ts # Main entry point
â âââ utils.ts # Utility functions
â âââ utils.spec.ts # Unit tests
âââ tests/
â âââ utils/
â â âââ test-helpers.ts # Shared test utilities
â âââ e2e/
â âââ integration.test.ts # E2E tests
âââ .gitignore
âââ .prettierignore
âââ .prettierrc # Prettier configuration
âââ .releaserc.json # Semantic-release configuration
âââ eslint.config.mjs # ESLint 9 flat config
âââ tsconfig.json # Base TypeScript config
âââ tsconfig.esm.json # ESM build config
âââ tsconfig.cjs.json # CommonJS build config
âââ tsup.config.ts # Bundler configuration
âââ typedoc.json # TypeDoc configuration
âââ vitest.config.ts # Vitest configuration
âââ package.json
âââ LICENSE
âââ README.md
This project uses semantic-release with conventional commits:
feat: - New feature (minor version bump)fix: - Bug fix (patch version bump)perf: - Performance improvement (patch version bump)docs: - Documentation changes (patch version bump)refactor: - Code refactoring (patch version bump)BREAKING CHANGE: - Breaking change (major version bump)feat: add new calculation function
fix: resolve issue with greet function
docs: update README with examples
BREAKING CHANGE: change API signature
The CI workflow runs on every push and pull request:
Tested on Node.js versions: 20.x, 22.x
The Release workflow runs on pushes to the main branch:
To enable NPM publishing, add your NPM token as a secret in GitHub:
NPM_TOKENCodecov is used for code coverage reporting. To enable Codecov:
CODECOV_TOKEN in your GitHub repository settingsGitHub releases are automatically created using the GITHUB_TOKEN provided by GitHub Actions.
MIT ÂĐ æåĪŠããĪããðļ
Contributions are welcome! Please feel free to submit a Pull Request.