Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ts-package-init) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ts-package-init
A fast, minimal, and modern TypeScript project initializer.
Create a TypeScript project with sensible defaults in seconds — no frameworks, no boilerplate overload.
✨ Features
- Zero-config TypeScript setup
- Presets:
base,library,backend,cli - CommonJS or ESM (
--esm) - Optional ESLint & Prettier
- Uses
tsxfor fast dev experience - Works with Node.js 18+
🚀 Usage
Quick start
npx ts-package-init my-app
cd my-app
npm run devUsing npm init
npm init ts-package my-app📦 Presets
Base (default)
Minimal runnable TypeScript project.
npx ts-package-init my-appScripts:
{
"build": "tsc",
"dev": "tsx watch src/index.ts"
}Library
For reusable npm packages.
npx ts-package-init my-lib --preset libraryIncludes:
- type declarations
- clean build output
Backend
For APIs, workers, and services.
npx ts-package-init api --preset backendIncludes:
dev,build,startscripts- long-running process defaults
CLI
For command-line tools.
npx ts-package-init my-cli --preset cliIncludes:
- executable binary
- Node shebang support
📘 ESM Support
Enable ESM with:
npx ts-package-init my-app --esmThis will:
- set
"type": "module" - adjust TypeScript config automatically
🧹 ESLint & Prettier (optional)
npx ts-package-init my-app --eslint
npx ts-package-init my-app --prettierPrettier automatically enables ESLint integration.
🧪 Examples
npx ts-package-init demo
npx ts-package-init my-lib --preset library --esm
npx ts-package-init api --preset backend --eslint --prettier
npx ts-package-init tool --preset cli🛣 Roadmap
- Preset-aware ESLint rules
- Interactive mode
- Monorepo preset
- Framework presets (NestJS, Moleculer)
📄 License
MIT