is-name-taken
Check if an NPM package name is taken
Last updated 4 years ago by bconnorwhite .
MIT · Repository · Original npm · Tarball · package.json
$ npm install is-name-taken 
SYNC missed versions from official npm registry.

is-name-taken

npm typescript Coverage Status GitHub stars Twitter Follow

Check if an NPM package name is taken.

Validates an NPM package name and then checks if a conflicting package exists. Also accounts for punctuation differences.

Installation

yarn add is-name-taken
npm install is-name-taken

API

import { isTaken, isValid } from "is-name-taken";

// Check if a package name is taken, and if so, return the conflict:

isTaken("ch-alk"); // "chalk"

// If not taken, return false

isTaken("package-that-doesnt-exist"); // false

// If invalid, return true

isTaken("INVALID_NAME"); // true

// Check if a package name is valid

isValid("chalk"); // true

isValid("INVALID_NAME"); // false

Types:

import { Options } from "is-name-taken";

type Options = {
  /**
   * Maximum milliseconds after a sync to avoid re-syncing
   */
  maxAge?: number;
  /**
   * Setting optimistic to true will skip syncing latest packages from NPM.
   * This is faster, but may lead to inconsistencies with recently published packages.
   */
  optimistic?: boolean;
};

function isValid(name: string): boolean;

function isTaken(name: string, options?: Options): Promise<string | boolean>;


Dependenciesdependencies


Dev DependenciesDavid


License license

MIT


Related Packages

Current Tags

  • 2.0.0                                ...           latest (4 years ago)

6 Versions

  • 2.0.0                                ...           4 years ago
  • 1.1.1                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Total 1
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE