Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Simple CLI tool to validate package names #65

Open
aarondill opened this issue Jan 4, 2023 · 6 comments
Open

[Feature Request] Simple CLI tool to validate package names #65

aarondill opened this issue Jan 4, 2023 · 6 comments

Comments

@aarondill
Copy link

aarondill commented Jan 4, 2023

This package would be even further useful if a simple CLI was included for use in scripts.
I envision this tool as something along the following:

validate-npm-package-name "valid-name" # Returns 0, no output

validate-npm-package-name "Invalid name:here" # Returns 1
# Stderr: 
# name can no longer contain capital letters
# name can only contain URL-friendly characters

This would allow for usage in scripts, and would further the usability of this tool.
The errors given would be the exact same as those given by the 'errors' property in the Javascript API.
By default, this tool would return errors if the name is no longer acceptable, but perhaps a `--legacy`` option could be adopted to return errors only on legacy errors.
Alternatively, the tool could provide different return values depending on invalidity, (ie, if valid: 0, if legacy valid: 1, if never valid: 2).

@CodeVibranium
Copy link

Hey @aarondill , is this issue still open?

@aarondill
Copy link
Author

yes. although it seems like maybe this repo is in maintenance-only mode?

@CodeVibranium
Copy link

yes. although it seems like maybe this repo is in maintenance-only mode?
@aarondill , If there are any issues to fix please let me know.

@broofa
Copy link

broofa commented Apr 22, 2024

@lukekarrys: Would you be open to a PR for this? Any opinions about what the name of the CLI should be?

@CodeVibranium
Copy link

CodeVibranium commented Apr 22, 2024

Sure, I'm in.
CLI name, give me some time @broofa

@lukekarrys
Copy link
Contributor

I think the current package name, although a little verbose, makes the most sense.

A good pattern to follow would be this repo where I recently separated the index and bin script npm/installed-package-contents#72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants