package-publishing

Installation
SKILL.md

Package Publishing

Overview

Covers modern npm package authoring: package.json configuration with the exports field, dual ESM/CJS builds, TypeScript type declarations, and secure publishing workflows with provenance.

When to use: Configuring package entry points, setting up conditional exports, building dual-format packages, publishing scoped packages, or troubleshooting module resolution.

When NOT to use: Application-level bundling (Vite/webpack app configs), monorepo workspace orchestration (Turborepo/Nx), private registry setup (Verdaccio/Artifactory).

Quick Reference

Pattern Field / Command Key Points
Entry point exports in package.json Replaces main/module; encapsulates internals
CJS fallback main Legacy consumers without exports support
ESM entry module Bundler convention; not used by Node.js
Type declarations types condition in exports Must be listed first in each condition block
Subpath exports "./utils": { ... } Clean public API; blocks deep imports
Related skills
Installs
39
GitHub Stars
11
First Seen
Feb 24, 2026