Skip to main content

jhol_core/
lib.rs

1//! Core library for Jhol: cache, install, doctor, registry, lockfile, backend, audit.
2//! Used by the CLI binary; can be reused by other tools (e.g. LSP, server).
3
4pub mod audit;
5pub mod backend;
6pub mod cdn;
7pub mod config;
8pub mod doctor;
9pub mod exec;
10pub mod http_client;
11pub mod install;
12pub mod lockfile;
13pub mod lockfile_write;
14pub mod osv;
15pub mod prefetch;
16pub mod registry;
17pub mod run;
18pub mod utils;
19pub mod ux;
20pub mod workspaces;
21
22// Re-export main API for CLI
23pub use audit::{generate_sbom, run_audit, run_audit_fix, run_audit_gate, run_audit_raw, SbomFormat};
24pub use backend::{bun_available, resolve_backend, Backend};
25pub use config::{load_config, Config};
26pub use doctor::{check_dependencies, fix_dependencies};
27pub use install::{
28    install_lockfile_only, install_package, resolve_install_from_package_json, InstallOptions,
29};
30pub use prefetch::prefetch_from_lockfile;
31pub use lockfile::{detect_lockfile, lockfile_integrity_complete, read_resolved_from_dir, LockfileKind};
32pub use run::{get_script_command, run_script};
33pub use exec::{exec_binary, find_binary_in_node_modules};
34pub use cdn::{esm_sh_url, fetch_esm_to_file};
35pub use workspaces::list_workspace_roots;
36pub use utils::{
37    cache_clean, cache_export, cache_import, cache_prune, cache_size_bytes, get_cache_dir,
38    init_cache, list_cached_packages, lockfile_content_hash, log, log_error,
39};
40pub use ux::{uninstall, update_packages, why_package};