⭐ Star this template if you find it useful
Stop wasting days on boilerplate setup and focus on what matters - your library code:
- Instant Setup: Start coding your library in less than 5 minutes
- Developer Experience: Hot reloading, type checking and fast testing
- Battle-tested Tools: Pre-configured ESLint, Prettier, Vitest, Husky, and more
- Future-proof: ESM & CommonJS support, full TypeScript strictness
- Automated Everything: From linting to releases to documentation
- Playground: A playground for testing your library
- TypeScript First: Full support for modern TypeScript with strict typing
- Dual Package: Outputs both ESM and CommonJS formats
- Optimized Build: Lightning-fast builds with Tsup
- Code Quality: Pre-configured ESLint and Prettier
- Testing Ready: Unit testing with Vitest
- Git Hooks: Enforced commit standards with Commitlint and Husky
- Documentation: Beautiful docs with Vitepress
- CI/CD: GitHub Actions for testing, publishing and deploying
- Semantic Release: Automated versioning and changelog generation
You can start using this template by clicking the green "Use this template" button on GitHub or by cloning the repository:
# Clone the repository
git clone https://github.com/fvena/typescript-library-template-pro.git your-library-name
cd your-library-name
# Install dependencies
npm install
Customize your project details before development:
- Project Metadata: Update
package.json
(name, version, author, etc.) - License: Edit
LICENSE
with your details - Docs Configuration: Update
docs/.vitepress/config.ts
(setbase
to repo name)
Optional (Recommended for Publishing):
- GitHub Secrets: Add
GH_TOKEN
andNPM_TOKEN
for releases - Enable GitHub Pages: Set GitHub Actions as the source for GitHub Pages
npm run dev # Development mode with auto-rebuild
npm run playground # Start the playground
npm test # Run tests
npm run doc:dev # Preview documentation
The deployment process is fully automated with GitHub Actions.
- Use Conventional Commits (feat:, fix:, etc.)
- Push to
main
- GitHub Actions will:
- Run tests & linting
- Update version & changelog
- Publish to NPM (if configured)
- Deploy docs (if enabled)
For detailed instructions on setup, customization, and advanced features, visit our 📘 documentation site.
Popular Sections
- Getting Started Guide: Step-by-step setup instructions
- Development Workflow: Best practices for smooth coding
- Testing Strategies: Unit testing, debugging, and CI
- Build & Configuration: Customizing the output format
- Release Process: Learn how versioning and publishing work
- Check the FAQs: Common questions are answered in the documentation
- Open an Issue: For bugs or feature requests
- Contribute: PRs are welcome! See our contribution guidelines
This template is MIT licensed - use it freely for personal and commercial projects.
Your ⭐ motivates continued development and maintenance