# npm-name

> Check whether a package or organization name is available on npm

Latest version **8.1.1** (published 2026-08-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install npm-name
pnpm add npm-name
yarn add npm-name
bun add npm-name
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 8.1.1 |
| Published | 2026-08-16 |
| First published | 2014-04-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=18 |
| Dependencies | 10 |
| Unpacked size | 11.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 176 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | name, available, package, organization, npm, pkg, app, check, taken |

## Links

- npm: https://www.npmjs.com/package/npm-name
- Repository: https://github.com/sindresorhus/npm-name
- Homepage: https://github.com/sindresorhus/npm-name#readme
- Issues: https://github.com/sindresorhus/npm-name/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/npm-name

## Dependencies (10)

- [ky](https://npm.io/package/ky.md) ^1.2.0
- [p-map](https://npm.io/package/p-map.md) ^7.0.1
- [p-limit](https://npm.io/package/p-limit.md) ^6.2.0
- [is-scoped](https://npm.io/package/is-scoped.md) ^3.0.0
- [org-regex](https://npm.io/package/org-regex.md) ^1.0.0
- [lodash.zip](https://npm.io/package/lodash.zip.md) ^4.2.0
- [registry-url](https://npm.io/package/registry-url.md) ^6.0.1
- [is-url-superb](https://npm.io/package/is-url-superb.md) ^6.1.0
- [registry-auth-token](https://npm.io/package/registry-auth-token.md) ^5.0.2
- [validate-npm-package-name](https://npm.io/package/validate-npm-package-name.md) ^5.0.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 8.1.1 (latest) — 2026-08-16
- 8.1.0 — 2026-02-02
- 8.0.0 — 2024-02-10
- 7.1.1 — 2023-10-14
- 7.1.0 — 2022-09-20
- 7.0.1 — 2022-05-02
- 7.0.0 — 2021-04-17
- 6.0.1 — 2020-06-26
- 6.0.0 — 2020-02-22
- 5.5.0 — 2019-06-30
- 5.4.0 — 2019-06-10
- 5.3.0 — 2019-03-31
- 5.2.0 — 2019-03-10
- 5.1.0 — 2019-02-04
- 5.0.1 — 2018-09-19
- … 20 more at https://npm.io/package/npm-name/versions

## README

# npm-name

> Check whether a package or organization name is available on npm

## Install

```sh
npm install npm-name
```

## Usage

```js
import npmName from 'npm-name';

// Check a package name
console.log(await npmName('chalk'));
//=> false

// Check an organization name
console.log(await npmName('@ava'));
//=> false

console.log(await npmName('@abc123'));
//=> true

try {
	await npmName('_ABC');
} catch (error) {
	console.log(error.message);
	// Invalid package name: _ABC
	// - name cannot start with an underscore
	// - name can no longer contain capital letters
}
```

## API

### npmName(name, options?)

Check whether a package/organization name is available (not registered) on npm.

An organization name should start with `@` and should not be a scoped package.

Returns a `Promise<boolean>` of whether the given name is available.

#### name

Type: `string`

The name to check.

#### options

Type: `object`

##### registryUrl

Default: User's configured npm registry URL.

The registry URL to check name availability against.

**Note:** You're unlikely to need this option. Most use-cases are best solved by using the default. You should only use this option if you need to check a package name against a specific registry.

### npmNameMany(names, options?)

Check whether multiple package/organization names are available (not registered) on npm.

Returns a `Promise<Map>` of name and status.

```js
import {npmNameMany} from 'npm-name';

const result = await npmNameMany(['chalk', '@sindresorhus/is', 'abc123']);

console.log(result.get('chalk'));
//=> false

console.log(result.get('@sindresorhus/is'));
//=> false

console.log(result.get('abc123'));
//=> true
```

#### names

Type: `string[]`

Multiple names to check.

#### options

Type: `object`

Same as `npmName()`.

## Known limitations

This package checks the npm registry to see if a name is already taken. It also makes a best-effort attempt to detect names that npm blocks at publish time for differing from an existing package only by punctuation (`-`, `.`, `_`): the registry strips punctuation from both names before comparing them. The detection tries the spellings that share the name's own word boundaries, so `ch-alk` and `lodash-merge` are reported as unavailable because `chalk` and `lodash.merge` exist, but it does not enumerate every possible spelling: `validate-io.string-primitive` is reported as available even though the registry blocks it, because `validate.io-string-primitive` exists with different boundaries.

A name with no punctuation can also conflict with an existing punctuated one, for example `lodashmerge` against `lodash.merge`. That direction cannot be enumerated from the client, as there is no way to ask the registry which existing names strip down to a given string.

However, npm also performs additional undocumented [similarity checks](https://blog.npmjs.org/post/168978377570/new-package-moniker-rules.html) server-side that may still reject a name at publish time even if this package reports it as available. There is no public API to replicate these checks.

## Related

- [npm-name-cli](https://github.com/sindresorhus/npm-name-cli) - CLI for this module

---
_Source: https://npm.io/package/npm-name · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
