npm Publish
Publish npm packages to the npm registry with sensible defaults:
- •Private by default - Sets
publishConfig.access: restricted - •Patch bump by default - Increments version by 0.0.1
Usage
bash
# Publish with defaults (private, patch bump) skill-npmpublish # Specify bump type skill-npmpublish --bump minor # 0.1.0 skill-npmpublish --bump major # 1.0.0 skill-npmpublish --bump patch # 0.0.1 (default) # Publish as public (use carefully!) skill-npmpublish --public # Dry run (see what would happen) skill-npmpublish --dry-run # Publish from a different directory skill-npmpublish --dir /path/to/package
Options
| Option | Description | Default |
|---|---|---|
-b, --bump <type> | Version bump: patch, minor, major | patch |
--public | Publish as public package | false (private) |
--dry-run | Preview without publishing | false |
-d, --dir <path> | Package directory | current dir |
Requirements
- •
NPM_TOKENin~/.secretsfor authentication - •Valid
package.jsonin target directory
What It Does
- •Reads
package.json - •Ensures
publishConfig.access: restricted(unless --public) - •Bumps version by specified amount (default: patch/0.0.1)
- •Updates
package.json - •Runs
bun publish - •Confirms private access on npm registry
Examples
bash
# Standard publish for internal package skill-npmpublish # Release new feature version skill-npmpublish --bump minor # Breaking change release skill-npmpublish --bump major # Check what would be published skill-npmpublish --dry-run