Skip to main content

Module modlist

Module modlist 

Source
Expand description

The mods.yml model and its read/write. The mods.yml model and its read/write.

mods.yml is a YAML array of ProfileMod and is the authoritative record of what is installed in a profile. The shape mirrors r2modman’s ManifestV2 so r2modman can read a profile this engine produced: keys are camelCase, the icon field is never written, and versionNumber is a nested object.

Structs§

ProfileMod
One installed mod, mirroring r2modman’s ManifestV2. Field order matches r2modman’s declaration order; icon is never serialized.
SemVer
The major.minor.patch version object, serialized as a nested mapping to match r2modman’s VersionNumber.

Functions§

find
Finds an installed mod by its Owner-Name identifier.
now_millis
The current time in the epoch-millisecond encoding ProfileMod::installed_at_time records, matching r2modman’s installedAtTime.
read
Reads <profile_dir>/mods.yml. A missing file is an empty list (a fresh profile), matching r2modman treating an absent list as [].
upsert
Inserts entry, replacing any existing entry with the same name.
write
Writes mods to <profile_dir>/mods.yml, creating the directory if needed.