Back to Skills

npm-exists

verified

Check if an npm package name exists in the registry. Use when the user asks if a package name is available, wants to check package existence, or verify if a package is published.

View on GitHub

Marketplace

mearman

Mearman/marketplace

Plugin

npm-registry

Repository

Mearman/marketplace
2stars

plugins/npm-registry/skills/npm-exists/SKILL.md

Last Verified

January 23, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/Mearman/marketplace/blob/main/plugins/npm-registry/skills/npm-exists/SKILL.md -a claude-code --skill npm-exists

Installation paths:

Claude
.claude/skills/npm-exists/
Powered by add-skill CLI

Instructions

# Check npm Package Existence

Check if a package name exists in the npm registry.

## Usage

```bash
npx tsx scripts/exists.ts <package-name> [options]
```

### Arguments

| Argument | Required | Description |
|----------|----------|-------------|
| `package-name` | Yes | The exact package name to check (case-sensitive) |

### Options

| Option | Description |
|--------|-------------|
| `--no-cache` | Bypass cache and fetch fresh data from API |

### Output

Package exists:
```
✓ Package "react" exists
  URL: https://www.npmjs.com/package/react
  Published: Yes
```

Package does not exist:
```
✗ Package "my-awesome-pkg-12345" does not exist
  The name is available for use
```

## Script Execution (Preferred)

```bash
npx tsx scripts/exists.ts <package-name> [options]
```

Options:
- `--no-cache` - Bypass cache and fetch fresh data from API

Run from the npm-registry plugin directory: `~/.claude/plugins/cache/npm-registry/`

## Existence Check API

```
HEAD https://registry.npmjs.org/{package}
```

### Parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| `package` | Yes | The exact package name to check (case-sensitive) |

### Examples

Check if a package exists:
```
HEAD https://registry.npmjs.org/react
```

For scoped packages:
```
HEAD https://registry.npmjs.org/@babel/core
```

## Response Interpretation

**Package exists** - HTTP 200 OK
- The package is published and available
- You can use `npm info` or `npm install` with this name

**Package does not exist** - HTTP 404 Not Found
- The package name is available for use
- No package with this exact name exists in the registry

Before publishing a new package, verify the name is available:
```bash
npx tsx exists.ts my-new-package
```

### Validate Package Name
Confirm a package exists before installing or using it:
```bash
npx tsx exists.ts some-dependency
```

### Scoped Packages
Check scoped package names:
```bash
npx tsx exists.ts @myorg/package-name
```

## Naming Rules

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
3144 chars