caniname
v1.0.0
Published
CLI tool to check project name availability across Netlify, NPM, and more.
Maintainers
Readme
caniname
Check availability of a project name across services (Netlify, NPM, and more).
Fun fact: This tool was originally built under the name
namecheck. Upon running./bin/namecheck.js namecheckto dogfood it before publishing, it turned out thatnamecheckwas already taken on both Netlify and NPM—so we used the tool itself to find an available name:caniname.
Usage
npx caniname formula-input
npx caniname formula-input calc-inputOr run locally:
./bin/caniname.js formula-input calc-inputOptions
-j, --json: Output results as JSON-h, --help: Show help message
Adding New Checks
Each check lives in its own file inside src/checks/. Any .js file placed in src/checks/ is automatically discovered and executed in parallel.
To add a new check, create src/checks/<service>.js with the following shape:
export async function check(name) {
const normalized = name.trim().toLowerCase();
const target = `${normalized}.example.com`;
const url = `https://${target}`;
// Perform availability check...
const available = true;
return {
id: 'example',
name: 'Example',
target,
url,
available,
};
}
export default {
id: 'example',
name: 'Example',
check,
};