std/zuzuzoo

Standard Library documentation

Plan and install Zuzu distributions.

Module

Name
std/zuzuzoo
Area
Standard Library
Source
modules/std/zuzuzoo.zzm

NAME

std/zuzuzoo - Plan and install Zuzu distributions.

IMPLEMENTATION SUPPORT

This module is supported by zuzu.pl, zuzu-rust, and zuzu-js on Node and Electron. It is not supported by zuzu-js in the browser.

DESCRIPTION

std/zuzuzoo provides the package-management engine used by the command-line zuzuzoo tool. It supports installed distribution metadata queries, source archive inspection, dependency-aware install planning, distribution test execution, file installation, planned target-root removal execution, installed metadata writing, standalone safe removal planning and execution, installed-file verification, latest-version checks, upgrade checks, and canonical pretty JSON formatting.

The command-line zuzuzoo wrapper delegates package behaviour to this module and handles argument parsing, user prompts, output formatting, JSON output selection, and exit-code translation.

EXPORTS

Functions

  • compare_versions(left, right)

    Parameters: left and right are version strings. Returns: Number. Compares two versions, returning a negative, zero, or positive value.

  • list_installed(options?), query(module_name, options?), query_distribution(distribution_name, options?)

    Parameters: names identify installed modules or distributions and options controls roots and output. Returns: value. Reads installed distribution metadata.

  • is_installed(module_name, min_version?, options?), installed_version(module_name, options?)

    Parameters: module_name identifies a module, min_version is optional, and options controls roots. Returns: Boolean or String/null. Checks installed module state.

  • pretty_json(value, options?), format_json(value, options?)

    Parameters: value is JSON-encodable data and options controls formatting. Returns: String. Formats canonical JSON output.

  • fetch_source(target, options?), load_distribution(target, options?)

    Parameters: target identifies a source archive or distribution and options controls fetch/load behaviour. Returns: value. Fetches or loads distribution metadata.

  • dependency_roots(options?), find_dependency(module_name, min_version?, options?)

    Parameters: options controls search roots and module_name names a dependency. Returns: value. Locates dependency sources.

  • plan_install(targets, options?), plan_remove(targets, options?)

    Parameters: targets is an array of requested modules or distributions. Returns: Dict. Builds an install or removal plan.

  • verify(targets, options?), latest(module_name, options?), can_upgrade(module_name, options?)

    Parameters: targets or module_name identify installed or remote items. Returns: value. Verifies installation state or checks available versions.

  • install(targets, options?), remove(targets, options?)

    Parameters: targets is an array of modules or distributions. Returns: Dict. Executes installation or removal.

  • run_distribution_tests(install_action, options?), execute_removal(removal_action, options?)

    Parameters: action dictionaries come from plans and options controls execution. Returns: Dict. Runs tests or executes one removal action.

  • format_install_plan(plan, options?), format_remove_plan(plan, options?)

    Parameters: plan is a plan dictionary. Returns: String. Formats a plan for display.

Classes

  • ZuzuzooLock

    Filesystem lock object.

    • lock.release()

      Parameters: none. Returns: null. Releases the lock.

  • Zuzuzoo

    Stateful package-management helper. Its methods correspond to the module-level functions and take the same parameters, without the final options argument where object configuration already supplies defaults.

    • zoo.config()

      Parameters: none. Returns: Dict. Returns the effective configuration.

    • zoo.acquire_lock(operation, options?)

      Parameters: operation names the operation and options controls locking. Returns: ZuzuzooLock. Acquires an operation lock.

    • zoo.find_installed_module(module_name, options?)

      Parameters: module_name identifies a module and options controls roots. Returns: Dict or null. Finds installed metadata for a module.

    • zoo.find_installed_distribution(distribution_name, options?)

      Parameters: distribution_name identifies a distribution and options controls roots. Returns: Dict or null. Finds installed metadata for a distribution.

COPYRIGHT AND LICENCE

std/zuzuzoo is copyright Toby Inkster.

It is free software; you may redistribute it and/or modify it under the terms of either the Artistic License 1.0 or the GNU General Public License version 2.