A modern TypeScript library starter template with best practices and tooling.
This template provides a solid foundation for building TypeScript libraries with modern tooling, testing, and development workflows.
- 🔧 TypeScript: Full TypeScript support with strict configuration
- 🧪 Testing: Vitest for fast and modern testing
- 📦 Bundling: Bun for fast builds and development
- 🎨 Linting: ESLint with TypeScript and Prettier integration
- 🔄 CI/CD: GitHub Actions workflow ready
- 📝 Changesets: Automated versioning and changelog generation
- 🪝 Git Hooks: Husky and lint-staged for pre-commit validation
- 🌍 Universal: ESM modules with proper type declarations
npm install my-typescript-libraryyarn add my-typescript-librarypnpm add my-typescript-librarybun add my-typescript-libraryimport { myFunction } from 'my-typescript-library'
// Your library usage here
const result = myFunction()
console.log(result)Description of your main function.
const result = myFunction()- Bun (recommended) or Node.js 18+
# Clone the repository
git clone https://github.com/username/my-typescript-library.git
cd my-typescript-library
# Install dependencies
bun install
# Start development mode
bun run dev# Development
bun run dev # Start development mode with watch
bun run build # Build the library
bun run typecheck # Run TypeScript type checking
# Testing
bun test # Run tests
bun run test:coverage # Run tests with coverage
bun run test:ui # Run tests with UI
# Linting and Formatting
bun run lint # Run ESLint
bun run lint:fix # Fix ESLint issues
bun run format # Format code with Prettier
bun run format:check # Check formatting
# Publishing
bun run prepublishOnly # Pre-publish checks (typecheck, lint, test, build)├── src/
│ └── index.ts # Main entry point
├── dist/ # Built files (auto-generated)
├── tests/ # Test files
├── package.json # Package configuration
├── tsconfig.json # TypeScript configuration
├── vitest.config.ts # Vitest configuration
├── eslint.config.js # ESLint configuration
└── README.md # This file
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with TypeScript
- Tested with Vitest
- Bundled with Bun