Zero-knowledge minimalistic template for creating a new npm package.
📘Docs Demo: https://34j.github.io/create-minimal-package/
📦️NPM Package Demo: https://www.npmjs.com/package/create-minimal-package
The proof that the config is minimalistic is shown below.
The main reason (☆) of the slight complexity is the need to specify the project structure (src, dist, test).
👾Github
⚙TypeScript:tsconfig.json: inherits @tsconfig/strictest: 4 lines for ☆, 3 lines for ES types
✨️Formatting
📦Packageing
⚠️ Testing
📖Documentation
☆ P❄Nix Support (Optional, only needed for Nix users)
nix develop --ignore-environment: many lines for Playwright support (optional, can be removed if Node.js only)uvx copier copy --trust "gh:34j/create-minimal-package" --vcs-ref main my-cool-package
🎤 What is your project name?
my-cool-package
🎤 What is your GitHub username?
34j
npx setup-npm-trusted-publish my-cool-package to reserve the package name and allow trusted publishing.GITHUB_USER and REPO_NAME using sed:GITHUB_USER="johnsmith"
REPO_NAME="my-cool-package"
sed -i.tmp "s/\([^@]\)34j/\1$GITHUB_USER/g; s/create-minimal-package\|my-package-name/$REPO_NAME/g;" package.json src/index.ts README.md
sed -i.tmp 's/"version": "[0-9.]*"/"version": "0.0.0"/' package.json
rm *.tmp
rm src/*.tmp
rm CHANGELOG.md
rm *.jinja
uv by uv tool install pre-commit and install hooks by pre-commit install.Source to GitHub Actions from Settings/Pages/Build and deployment---.Inspired by node-module-boilerplate and typescript-npm-package-template, which is great but unnecessarily complex and poorly maintained.
📘Documentation: https://34j.github.io/create-minimal-package/
📦️NPM Package: https://www.npmjs.com/package/create-minimal-package
TODO: Project Description.
npm install create-minimal-package
import { myPackage } from 'create-minimal-package'
myPackage('hello')
// => 'hello from my package'