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
//! `ci` — install the exact tree a `package-lock.json` pins (= `npm ci`).

use std::path::Path;

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

/// Install the exact, integrity-checked tree the lockfile pins into `<dir>/node_modules/`.
pub(super) fn run(dir: &Path) -> Res {
    report_installed(&from_lockfile(&dir.join("package-lock.json"), dir)?);
    Ok(())
}