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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@minecraft/api-docs-generator

v1.2.6

Published

Core Minecraft API Docs Generator package for generating API markup and documentation

Readme

@minecraft/api-docs-generator

This package ingests Minecraft API module metadata and outputs various generated files such as documentation, TypeScript .d.ts files, and more. Requires usage of a markup generator plugin to provide output configurations, such as @minecraft/markup-generators-plugin or a custom defined plugin.

Installation

  • Install NPM/Node version 22.x or above.
  • Clone this repository.
  • Install dependencies: npm install
  • Build the repository: npm run build

CLI Usage

Usage: minecraft-api-docs-generator [options]

Options:

  -i, --input-directory           Directory of the API metadata JSON input files.
  -o, --output-directory          Directory to output generated types and documentation to.
  -d, --docs-directory            Directory of the documentation info.JSON files that provide description strings for API modules.
  -g, --run-generators            IDs of markup generators to render output files with.

  -m, --include-modules           Mode which determines which input modules should be included in generation.
  -b, --include-base              If set, will include base modules in generation for metadata that would be merged to a parent module.
      --changelog-strategy        String ID of the changelog strategy to use when comparing modules.

  -p, --plugin                    Plugin packages to import generators and templates from.
  -c, --config                    Path to a config file with options.
      --no-config                 If set, will not look for any config files.

  -l, --log                       Logging options.
  -s, --suppress                  Suppresses all output except for errors

      --version                   Show version number
  -h, --help                      Show help

Example

minecraft-api-docs-generator -i ./input -o ./out -d ./docs -g msdocs ts

Markup Generators

The run-generators argument requires the ID of a markup generator defined in a plugin package imported via the plugin argument or in the config file.

Multiple markup generators can be ran in the same instance by supplying multiple IDs, e.g.: --run-generators msdocs ts

By default, @minecraft/api-docs-generator will assume you have imported @minecraft/markup-generators-plugin if no other plugins are defined via CLI or config options. See the markup-generators-plugin README for more info.

Plugins

The plugin argument allows importing additional markup generators from external plugin packages. See ARCHITECTURE for more info on creating and using external plugins for custom functionality.

Generating API Types

To generate API types using the most recent type metadata:

  1. Use NPM to globally install both api-docs-generator and the markup generators plugin: npm install -g @minecraft/api-docs-generator @minecraft/markup-generators-plugin
  2. Clone the bedrock-samples repository.
  3. Run the generator using bedrock-samples\metadata as the input directory. e.g.:
minecraft-api-docs-generator -i C:\bedrock-samples\metadata -o .\out

Development

npm run build compiles @minecraft/api-doc-generator TS definitions and JS files into lib.

npm run lint runs ESLint and Prettier on project TS source files. npm run lint:fix attempts to fix Prettier issues.

npm run test runs a suite of tests. npm run test:update updates the test snapshots. See Testing for more details.

npm run clean cleans all build output.

npm run package generates an NPM tarball which you can then npm install in other NPM packages for local tool usage.

Debugging

We recommend using Visual Studio Code's JavaScript Debug Terminal for debugging purposes.

Testing

This package is validated with a series of vitest snapshot tests that validate generated markup for specific scenarios. When making changes to the generator, please add new scenarios or update the existing scenarios.

Snapshot tests will fail if the number of files generated or the contents of the files change. If snapshot changes are expected, you can update them by running: npm run test:update at the root of the repository.

It is possible to run specific tests using npm run test -- -- --test <name>, where <name> is a pattern matching .test.ts/.spec.tsfile names. Running this in the JavaScript Debug Terminal allows for debugging specific tests (see above).