Skip to content
Public template

About

TypeScript npm package template: tsdown, Vitest, oxc, Changesets, Trusted Publishing

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

PACKAGE_NAME

npm bundle size CI provenance zero deps

One sentence: the pain, then the fix.

The problem

The fix

import { clamp } from 'PACKAGE_NAME/example'

clamp(15, 0, 10) // 10

Install

npm install PACKAGE_NAME

Works in Node 20+, Bun, Deno and browsers. ESM and CommonJS, fully typed, zero dependencies.

API

PACKAGE_NAME/example

clamp(value, min, max)

How it differs from alternatives

PACKAGE_NAME alternative-a alternative-b
Zero dependencies ✅
Size (min+gzip)

License

MIT © nightlightmare


Using this template

  1. On GitHub: Use this template → name the repo after the npm package.
  2. Replace PACKAGE_NAME and PACKAGE_DESCRIPTION across the repo; fill keywords.
  3. Rename src/example/ to your first module and update exports, size-limit and tsdown.config.ts.
  4. Update the per-subpath checks in scripts/smoke.mjs.
  5. pnpm install && pnpm coverage && pnpm build && pnpm smoke && pnpm check:publish && pnpm size
  6. npmjs.com → package → Settings → Trusted Publisher: GitHub Actions, this repo, workflow release.yml.
  7. When the first release is ready, remove "private": true from package.json. Until then the release workflow publishes nothing.
  8. Create the triage labels: for l in needs-triage needs-info ready-for-agent ready-for-human wontfix; do gh label create $l; done

About

TypeScript npm package template: tsdown, Vitest, oxc, Changesets, Trusted Publishing

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages