A modern TypeScript package template using Bun for builds/testing and Biome for linting/formatting.
- TypeScript with strict type checking
- Bun for fast builds and testing
- Biome for linting and formatting
- Dual ESM/CJS output
- Type declarations included
- Ready for npm publishing
- Bun >= 1.0.0
bun install# Run the package
bun run dev
# Build the package
bun run build
# Run tests
bun test
# Run tests in watch mode
bun test --watch
# Lint
bun run lint
# Format
bun run format
# Check (lint + format)
bun run check
# Fix all issues
bun run check:fix
# Type check
bun run type-checkimport { greet } from "my-package-template";
// Simple usage
greet("Hello, world!");
// With options
greet({
message: "Hello!",
times: 3,
logger: console.log,
});src/
├── index.ts # Main entry point, exports all modules
├── greet.ts # Example module
├── greet.test.ts # Tests
└── types.ts # Type definitions
The build script generates:
dist/index.js- ESM moduledist/index.cjs- CommonJS moduledist/index.d.ts- TypeScript declarations
bun run buildTests use Bun's built-in test runner:
bun test- Update version in
package.json - Run the CI check:
bun run ci - Publish:
npm publish
Preview what will be published:
bun run npm-dry-runSee biome.json for linting and formatting rules.
See tsconfig.json for TypeScript configuration.
MIT