8.0.0 • Published 3 months ago

npm-name v8.0.0

Weekly downloads
43,686
License
MIT
Repository
github
Last release
3 months ago

npm-name

Check whether a package or organization name is available on npm

Install

npm install npm-name

Usage

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.

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().

Related

@cyber-start/create-cyber-library@cyber-start/create-cyber-tools@cyber-tools/cyber-order@cyber-tools/lib-clireactifiretypescriptifire@yushicheng/create-private-lib@cyber-tools/work-cli@cyber-work/create-cyber-work@cyber-work/lib-cli@cyber-work/work-cliwork-scriptsgenerator-easy-gruntplugingenerator-easy-nodegenerator-howmanylaor-clicogoportutils@everything-registry/sub-chunk-2341version-existshmainquirer-npm-namewordagereact-library-generatorkanuki-cliwzukzjslqshqz-docmalionp@infinitebrahmanuniverse/nolb-npm-nzf-np@hopocode/node-startermama-exporter@jacekpietal/docmayo-helperyarghpm-cli@kylemh/npshoobertmaster-inquisitorsindredashsindresorhus.jssipitatomicboaravailable-npm-namescheckpackage@bee-icons/qwikconfusion-test@cyber-tools/create-cyber-library@cyber-tools/create-cyber-tools@cyber-tools/cyber-npmeverything-okdocmadiscord.js-bycondiscordjs-con-selfdext-core-utilscreate-packagecreate-gatsby-themecreate-lib-reactgenerator-doc-metrix-docgenerator-doc-metrix-nodegenerator-fepgenerator-hapi-plugingenerator-babel-plugingenerator-baregenerator-baboongenerator-beargenerator-bearyhubotgenerator-boilerplate-generatorgenerator-knockout-gulp-bootstrapgenerator-kpmgenerator-maurizzzio-node-gulpgenerator-node-cleargenerator-node-gulpgenerator-node-gulp-coffeegenerator-node-npmgenerator-kitagenerator-lintelgenerator-ntesmailgenerator-nodestackgenerator-leanbotgenerator-mtb-appgenerator-mygeneratorgenerator-ngfisgenerator-onereqgenerator-appverse-gruntgenerator-assemble-skeletorgenerator-atomicboargenerator-aliyun-buygenerator-gruntplugingenerator-hubot-yarngenerator-hubulargenerator-hydra-dashgenerator-broccoligenerator-devebotgenerator-distributions-iogenerator-flow-iogenerator-ionicparsegenerator-iojsgenerator-ionicgenerator-ionic-cloudgenerator-isocket-cortex
8.0.0

3 months ago

7.1.1

7 months ago

7.1.0

2 years ago

7.0.1

2 years ago

7.0.0

3 years ago

6.0.1

4 years ago

6.0.0

4 years ago

5.5.0

5 years ago

5.4.0

5 years ago

5.3.0

5 years ago

5.2.0

5 years ago

5.1.0

5 years ago

5.0.1

6 years ago

5.0.0

6 years ago

4.1.0

6 years ago

4.0.0

6 years ago

3.2.0

6 years ago

3.1.0

7 years ago

3.0.0

8 years ago

2.1.0

8 years ago

2.0.0

9 years ago

1.2.0

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago