3 releases

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

#1959 in Parser implementations

Download history 11/week @ 2024-09-13 13/week @ 2024-09-20 8/week @ 2024-09-27 2/week @ 2024-10-04

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