create-bun-package
v1.0.0
Published
CLI tool to scaffold new Bun/Node.js packages with TypeScript, ESM/CJS dual format, testing, and CI/CD
Maintainers
Readme
create-bun-package
🚀 CLI tool to scaffold new Bun/Node.js packages with TypeScript, ESM/CJS dual format, testing, and CI/CD
✨ Features
Instantly create a new npm package with:
- 🔷 TypeScript with strict mode
- 📦 ESM + CJS dual format build
- 🧹 Biome for linting and formatting
- 🧪 Bun test runner with coverage
- 🔄 GitHub Actions CI/CD
- 🏷️ Release Please for automated releases
- 🪝 Pre-commit hooks with lint-staged
📦 Usage
# Using npx
npx create-bun-package my-package
# Using bunx
bunx create-bun-package my-package
# With options
npx create-bun-package my-package -d "My awesome package"🛠️ Options
| Option | Alias | Description |
|--------|-------|-------------|
| --description | -d | Package description |
| --repo | -r | GitHub repository name (defaults to package name) |
| --author | -a | Author name and email |
| --help | -h | Show help message |
| --version | -v | Show version |
📝 Examples
# Basic usage
npx create-bun-package my-sdk
# With description
npx create-bun-package my-sdk -d "A powerful SDK for something"
# With all options
npx create-bun-package my-sdk \
-d "A powerful SDK" \
-r my-sdk-repo \
-a "Your Name <[email protected]>"📁 Generated Project Structure
my-package/
├── .github/
│ ├── workflows/
│ │ ├── ci.yml
│ │ └── release-please.yml
│ ├── ISSUE_TEMPLATE/
│ └── PULL_REQUEST_TEMPLATE.md
├── src/
│ └── index.ts
├── tests/
│ └── index.test.ts
├── .gitignore
├── biome.json
├── build.ts
├── bunfig.toml
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── package.json
├── README.md
├── tsconfig.json
└── tsconfig.build.json🚀 After Creation
# Enter your new package directory
cd my-package
# Start developing
# Edit src/index.ts
# Run tests
bun test
# Build
bun run build
# When ready, push to GitHub
git remote add origin [email protected]:username/my-package.git
git add .
git commit -m "chore: initial commit"
git push -u origin main📝 License
MIT © Carl Lee
