๐ฆ Template Package
Easy-to-use template for TypeScript libraries for UI or Node.js. It's made for personal use but open for everyone to contribute or suggest improvements.
๐ Why Use This Template?
Skip the setup and dive right into coding. This toolkit is perfect for any TypeScript package, packed with best practices.
โจ Motivation
This template is my own solution, born out of a desire to have a setup that fits just right for me. I was aware of create-typescript-app, yet I chose to make my own. Through this process, I am continuously gaining valuable insights and skills, and I intend to keep refining this template as I learn more.
๐ Getting Started
To kick off with this template, choose any of these methods. Don't forget to run pnpm run init
to customize it for your project (not needed for the NPX script):
- Use Template on GitHub: Just click 'Use this template'.
- โค๏ธ This method helps promote this repository to new interested developers.
- Git Clone:
git clone https://github.com/mxmalykhin/template-package.git your-library-name
.
- Download ZIP: Just download and unzip.
- NPX Script: (Coming Soon)
npx template-package init
will do all the setup for you.
๐ Tip: 'Use this template' on GitHub is quick and shares the love. NPX script will make it even easier soon.
๐ฃ Next Steps: Once the template is installed, pnpm run init
gets your template tailored to your needs.
๐ Development Tools
I use esbuild
for speedy development builds (pnpm run dev
) and rollup-plugin-typescript2
for more thorough type checking in production builds (pnpm run build
). This ensures fast iteration and reliable code.
๐งช Test Your Work
Before sharing your library, test it in real projects to ensure it works as expected:
- npm link: Great for local testing.
- yarn link/pnpm link: Alternative options that work similarly to
pnpm link
.
๐ง Environment Support
Supports ESM/CJS/UMD/IIFE for broad compatibility. This template is designed to work in Node.js, the browser, and other environments.
๐ ESM-Centric Approach
Striving for a "first-class solution" in ESM, this template is an endeavor to stay at the forefront of JavaScript development practices, ensuring efficiency and modern standards are met.
๐ก Contributing
Want to contribute? Great! Feel free to fork, make changes, and submit pull requests. Whether it's fixing bugs, adding features, or improving documentation, all contributions are welcome.
โจ Features
๐ Note
This template is a starting point. Feel free to customize it to fit your project's needs.