use-npm 0.0.1

npm command and package spec primitives for RustUse
Documentation
  • Coverage
  • 42.86%
    12 out of 28 items documented1 out of 14 items with examples
  • Size
  • Source code size: 9.15 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 739.01 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-js
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-npm

npm command and package spec primitives for RustUse.

Experimental

use-npm is experimental while use-js remains below 0.3.0.

Example

use use_npm::{NpmCommand, NpmPackageSpec, NpmRegistryUrl};

let registry = NpmRegistryUrl::new("https://registry.npmjs.org/")?;
let spec = NpmPackageSpec::new("react@latest")?;

assert_eq!(registry.as_str(), "https://registry.npmjs.org/");
assert_eq!(spec.as_str(), "react@latest");
assert_eq!("ci".parse::<NpmCommand>()?, NpmCommand::Ci);
# Ok::<(), Box<dyn std::error::Error>>(())

Scope

  • npm command labels.
  • Script command text.
  • Registry URL and package spec metadata.

Non-goals

  • Running npm.
  • Registry API calls.
  • Full npm package spec parsing.

License

Licensed under either Apache-2.0 or MIT.