Skip to main content

is_valid_package_name

Function is_valid_package_name 

Source
pub fn is_valid_package_name(name: &str) -> bool
Expand description

Check if a string looks like a valid npm package name.

Rejects strings that are clearly not packages: shell variables ($X), pure numbers, strings starting with !, empty strings, etc. This prevents false “unlisted dependency” reports for test fixture artifacts like $DIR or 1.