npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mctools/modlist

v0.1.2

Published

Generate .md file with all mods listed

Downloads

4

Readme

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:

  1. Generate modlist with any additional information of mods, such as mod name, description, link, image, download count and many more.
  2. Generate changes by comparing two minecraftinstance.json files. Useful for changelogs or forked modpacks.

Example of resulted file with icons and formatting:

Example of output file

Result of comparsion two manifests:

Example of comparsion

Usage

You can use this package either as CLI tool or as library.

To use as CLI tool:

  1. Install latest NodeJS for Windows or Unix

  2. Open console, navigate to your Minecraft directory (one with the mods/ directory or options.txt file)

    > cd C:/Instances/MyModpack
  3. 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:

  1. Install package
npm i @mctools/modlist
  1. 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

Author

  • https://github.com/Krutoy242

Other tools