Skip to content
Back to skills

Bun Publish

ASecurity

Publish package to npm with Bun build

  • 57 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 17, 2026
toolsbash

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned October 17, 2026

npx -y skills add diegosouzapw/awesome-omni-skill --skill bun-publish --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Bun Publish?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Bun Publish
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/diegosouzapw-bun-publish/badge)](https://www.skillsdirectory.com/skills/diegosouzapw-bun-publish)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
model: haiku
description: Publish package to npm with Bun build
args: [--dry-run] [--access <level>] [--provenance]
allowed-tools: Bash, Read
argument-hint: [--dry-run] [--access public]
disable-model-invocation: true
created: 2025-12-21
modified: 2025-12-21
reviewed: 2025-12-21
name: bun-publish
---

# /bun:publish

Publish package to npm registry after building with Bun.

## Parameters

- `--dry-run`: Preview publish without executing
- `--access`: Access level (`public` or `restricted`)
- `--provenance`: Enable supply chain provenance signing

## Context

Detect package configuration:
```bash
cat package.json | jq '{name, version, publishConfig, bin, files, scripts: {prepublishOnly: .scripts.prepublishOnly}}'
```

## Execution

### Pre-publish Validation

```bash
# Type check
bun run tsc --noEmit 2>&1 | head -20

# Build
bun run build

# Verify tarball contents
npm pack --dry-run
```

### Publish

**Dry run (default for first attempt):**
```bash
npm publish --dry-run {{ "--access " + ACCESS if ACCESS }}
```

**Actual publish:**
```bash
# Standard package
npm publish {{ "--access " + ACCESS if ACCESS }} {{ "--provenance" if PROVENANCE }}

# Scoped package (auto-detect from name starting with @)
npm publish --access public {{ "--provenance" if PROVENANCE }}
```

## Scoped Package Detection

If `package.json` name starts with `@`:
- Automatically add `--access public` unless explicitly restricted
- Warn if `publishConfig.access` is not set in package.json

## Post-publish

1. Display published version: `npm view <package> version`
2. Show installation command: `npm install <package>`
3. Link to npm package page

## Error Handling

**402 Payment Required:**
- Scoped packages require `--access public` for public registry
- Add `publishConfig.access: "public"` to package.json

**Missing authentication:**
- Run `npm login` to authenticate
- Or set `NPM_TOKEN` environment variable

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.