@mctools/modlist
Generate .md file with all mods listed
This tool was created for the mod list of E2E-E modpack as well as for its changelogs.
This tool can be used for two purposes:
- Generate modlist with any additional information of mods, such as
mod name
,description
,link
,image
,download count
and many more. - Generate changes by comparing two
minecraftinstance.json
files. Useful for changelogs or forked modpacks.
Example of resulted file with icons and formatting:
Result of comparsion two manifests:
Usage
You can use this package either as CLI tool or as library.
To use as CLI tool:
-
Open console, navigate to your Minecraft directory (one with the
mods/
directory oroptions.txt
file)> cd C:/Instances/MyModpack
-
Run:
> npx @mctools/modlist --help
Options
Options:
--version Show version number [boolean]
-k, --key Path to file with CurseForge API key.
Get one at https://console.curseforge.com/?#/api-keys.
If omitted, environment variable `CURSE_FORGE_API_KEY` would be used instead. [string]
-i, --ignore Path to ignore file similar to .gitignore.
Used to exclude mods that used only in dev environment and should not be included in mod list.
`ignore` file content example: "mods/tellme-*" [string]
-m, --mcinstance Path to instance json.
This json file generates by CurseForge launcher.
It located at the root of Minecraft instance folder. [default: "minecraftinstance.json"]
-l, --old Path to old instance json to compare with.
This option is useful when you want to make changelog and compare two modpack versions. [string]
-t, --template Path to Handlebar template.
See `default.hbs` for more info.
-s, --sort Sort field of CurseForge addon.
Accept deep path like `cf2Addon.downloadCount`.
`/` symbol at start of value flip sort order. [default: "addonID"]
-o, --output Path to output file. [default: "MODS.md"]
-v, --verbose Log working process in stdout [boolean]
-h, --help Show help [boolean]
Examples:
npx @mctools/modlist If executed from minecraft folder, generate MODS.md file in same folder.
Environment must have variable CURSE_FORGE_API_KEY.
npx @mctools/modlist --key=~secret_api_key.txt Create mod list,
but take key from secret_api_key.txt file
npx @mctools/modlist --ignore=devonly.ignore Use .gitignore-like file to exclude mods,
that should not present in list.
npx @mctools/modlist --mcinstance=mci.json Generate mod list based non-default
named minecraftinstance.json file.
npx @mctools/modlist --old=minecraftinstance_old.json Generate comparsion of two modpacks / modpack versions.
Useful for generating modpack changelog.
npx @mctools/modlist --template=fancy.hbs Use custom template for generating list.
npx @mctools/modlist --sort=/cf2Addon.downloadCount Sort mods in resulted list by their download count
instead of by default ID.
npx @mctools/modlist --output=modlist.md Rename output list instead of default MODS.md
npx @mctools/modlist --verbose Write some information in terminal
API
To use as library:
- Install package
npm i @mctools/modlist
- Import functions from package.
import {...} from "@mctools/modlist"
Interfaces
Functions
generateModsList
▸ generateModsList(mcInstanceFresh
, mcInstanceOld?
, opts?
): Promise
<string
>
Generate modlist for given minecraftinstance.json
file
Parameters
Name | Type | Description |
---|---|---|
mcInstanceFresh |
Minecraftinstance |
Json object from minecraftinstance.json of current version |
mcInstanceOld? |
Minecraftinstance |
Json object from minecraftinstance.json of previous version. |
opts? |
ModListOpts |
Options for mod list generator |
Returns
Promise
<string
>
Markdown file based on given Handlebars template