3 releases
0.1.2 | Aug 2, 2024 |
---|---|
0.1.1 | May 23, 2024 |
0.1.0 | May 23, 2024 |
#1962 in Parser implementations
216 downloads per month
14KB
273 lines
valid_npm_name
Check whether a package name is a valid npm package name.
Usage
use valid_npm_name::ValidName;
let foo = ValidName::parse("foo").unwrap();
assert_eq!("foo", foo.to_string());
let bar_name = ValidName::parse("bar").unwrap();
let bar = bar_name.as_ref();
assert_eq!("bar", bar);
let baz = ValidName::parse("baz").unwrap();
assert_eq!("baz", baz.as_str());
Dependencies
~0.6–1.1MB
~24K SLoC