3 releases

0.1.2 Aug 2, 2024
0.1.1 May 23, 2024
0.1.0 May 23, 2024

#1962 in Parser implementations

Download history 95/week @ 2024-07-29 6/week @ 2024-08-05 13/week @ 2024-09-16 11/week @ 2024-09-23 10/week @ 2024-09-30

216 downloads per month

Apache-2.0

14KB
273 lines

valid_npm_name

Cargo Documentation

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