npm-utils 0.5.0

Pure-Rust utilities for the npm registry: resolve a package version, download npm tarballs and GitHub archives, and extract files.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! `install` — resolve `package.json`'s `dependencies` and install `node_modules/`
//! (= `npm install`).

use std::path::Path;

use super::common::report_installed;
use super::Res;
use crate::install::node_modules;

/// Resolve the manifest's transitive dependencies against the registry and install the flat tree.
pub(super) fn run(dir: &Path) -> Res {
    report_installed(&node_modules(&dir.join("package.json"), dir)?);
    Ok(())
}