Skip to content

A simple command-line tool to check whether an NPM package or organization name is available or already taken.

License

Notifications You must be signed in to change notification settings

riobits/usename

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

usename

A simple command-line tool and library to check whether an NPM package or organization name is available or already taken.


📦 Installation

Global install (CLI)

npm install -g usename

Using npx (no install needed)

npx usename <package-name>

⚡ CLI Usage

Check a single package name

usename react
# or using npx
npx usename react

Example Output:

🔍 Searching for "react"...

🌐 Organization  : Taken
📦 Package       : Taken

Interactive / Loop Mode

To check multiple names repeatedly:

npx usename -l
  • You will be prompted to enter a package name each time.
  • To exit the loop, type:
exit

or press Ctrl+C.


🖋 Library Usage

You can also use usename in your own Node.js or TypeScript projects:

import { runCLI, searchForPackage } from 'usename'

// Run CLI programmatically
await runCLI('react')

// Check package/org availability directly
const result = await searchForPackage('my-unique-package')
console.log(result)
// { orgTaken: false, packageTaken: true }
  • runCLI(packageName?: string, showExitMsg?: boolean) Runs the CLI programmatically. showExitMsg will display exit instructions when true.

  • searchForPackage(name: string) Checks if an NPM package and organization name are taken and returns an object:

    { orgTaken: boolean, packageTaken: boolean }

📌 Notes

  • usename works both as a CLI tool and as a library in your code.
  • In CLI mode, the tool shows a spinner and colored output.
  • In library mode, you can call the functions directly for programmatic checks.

About

A simple command-line tool to check whether an NPM package or organization name is available or already taken.

Resources

License

Stars

Watchers

Forks