php-framework/docs/publish/npm.md
Snider f831fd6846 docs: restructure with Build/Publish sections and dynamic nav
- Move PHP and Go framework docs from /packages/ to /build/
- Move CLI docs from /packages/go/cmd/ to /build/cli/
- Add /publish/ section with docs for all release publishers:
  GitHub, Docker, npm, Homebrew, Scoop, AUR, Chocolatey, LinuxKit
- Add sidebar navigation for /publish/ section
- Update nav with Build, Publish, Deploy dropdowns
- Remove changelog, contributing, guide, and security sections
- Make sidebar auto-discover from packages, build, publish, deploy dirs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 22:20:32 +00:00

77 lines
1.2 KiB
Markdown

# npm
Publish JavaScript/TypeScript packages to the npm registry.
## Configuration
```yaml
publishers:
- type: npm
package: "@org/myapp"
access: public
```
## Options
| Option | Description | Default |
|--------|-------------|---------|
| `package` | Package name | From `package.json` |
| `access` | Access level (`public`, `restricted`) | `restricted` |
| `tag` | Distribution tag | `latest` |
| `directory` | Package directory | `.` |
## Examples
### Public Package
```yaml
publishers:
- type: npm
package: "@host-uk/cli"
access: public
```
### Scoped Private Package
```yaml
publishers:
- type: npm
package: "@myorg/internal-tool"
access: restricted
```
### Beta Release
```yaml
publishers:
- type: npm
tag: beta
```
### Monorepo Package
```yaml
publishers:
- type: npm
directory: packages/sdk
```
## Environment Variables
| Variable | Description |
|----------|-------------|
| `NPM_TOKEN` | npm access token (required) |
## Setup
1. Create an npm access token:
```bash
npm token create --read-only=false
```
2. Add to your CI environment as `NPM_TOKEN`
3. For scoped packages, ensure the scope is linked to your org:
```bash
npm login --scope=@myorg
```