# @jacobbubu/npm-name

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

Latest version **6.0.1** (published 2020-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jacobbubu/npm-name
pnpm add @jacobbubu/npm-name
yarn add @jacobbubu/npm-name
bun add @jacobbubu/npm-name
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 6.0.1 |
| Published | 2020-11-07 |
| First published | 2020-11-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 9 |
| Unpacked size | 8.8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Rong Shen |
| Maintainers | jacobbubu |
| Keywords | name, available, package, organization, npm, pkg, app, check, taken |

## Links

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

## Dependencies (9)

- [got](https://npm.io/package/got.md) ^10.6.0
- [p-map](https://npm.io/package/p-map.md) ^3.0.0
- [is-scoped](https://npm.io/package/is-scoped.md) ^2.1.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) ^5.1.0
- [is-url-superb](https://npm.io/package/is-url-superb.md) ^4.0.0
- [registry-auth-token](https://npm.io/package/registry-auth-token.md) ^4.0.0
- [validate-npm-package-name](https://npm.io/package/validate-npm-package-name.md) ^3.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

- 6.0.1 (latest) — 2020-11-07

## README

# npm-name [![Build Status](https://travis-ci.org/sindresorhus/npm-name.svg?branch=master)](https://travis-ci.org/sindresorhus/npm-name)

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

## Install

```
$ npm install npm-name
```

## Usage

```js
const npmName = require('npm-name');

(async () => {
	// 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


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

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

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

	console.log(result.get('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`

Name to check.

#### options

Type: `object`

##### registryUrl

Default: User's configured npm registry URL.

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.

### npmName.many(names, options?)

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

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

#### names

Type: `string[]`

Multiple names to check.

#### options

Type: `object`

Same as `npmName()`.

## Related

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

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