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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mafiahub/services-cli

v0.4.7

Published

MafiaHub build publishing and scripting documentation CLI

Readme

MafiaHub Services CLI

Build publishing and scripting API documentation tooling for MafiaHub mods.

Generate scripting API documentation

The CLI converts schema-v2 binding metadata emitted by the MafiaHub v8pp integration into TypeScript declarations, checks those declarations against C++ binding names, validates them with TypeScript, and renders static HTML and TypeDoc JSON.

npm install --save-dev @mafiahub/services-cli
npx mafiahub-services docs check --config ./scripting-api/docs.config.json
npx mafiahub-services docs generate --config ./scripting-api/docs.config.json --out ./build/docs

Mods own docs.config.json, declarations, guides, and theme overrides. The configuration schema is published at node_modules/@mafiahub/services-cli/schema/scripting-docs.schema.json. Metadata-backed targets must define both metadataFile and generatedEntryPoint; the mod build is responsible for producing the metadata JSON before invoking the CLI.

Native event contracts can be exported as a metadata data type named EventMap. Define one property per event and use a named TypeScript tuple for its callback arguments, such as [player: Player, text: string]. The generated declarations preserve that interface as the event reference and add type EventName = keyof EventMap, keeping event-name autocomplete and the HTML event list derived from the same runtime metadata.

Custom Markdown documents can be included for every API target with top-level documents, or for one target with targets.<name>.documents. Paths and glob patterns are resolved relative to docs.config.json. TypeDoc adds these pages to navigation and copies locally referenced images into the generated static bundle.

{
    "schemaVersion": 1,
    "slug": "example-mod",
    "title": "Example scripting API",
    "tagline": "Reference and guides for Example Mod.",
    "readme": "documentation/README.md",
    "documents": ["documentation/guides/**/*.md"],
    "targets": {
        "client": {
            "label": "Client API",
            "entryPoint": "generated/client.d.ts",
            "tsconfig": "tsconfig.json",
            "description": "Client scripting APIs.",
            "documents": ["documentation/client/**/*.md"]
        }
    }
}

Keep images beside their guides and reference them with relative Markdown paths, for example ![Server browser](./assets/server-browser.webp).

Publish artifacts

mafiahub-services builds publish \
    --api-url https://api.example.com \
    --mod-id 00000000-0000-0000-0000-000000000000 \
    --channel stable \
    --version 1.0.0 \
    --root ./dist/game

Set MAFIAHUB_BUILD_UPLOAD_TOKEN in CI, or pass --token / --token-file.

--api-url accepts either the API base URL or its /graphql endpoint. Build publishing uses the initBuildUpload and finalizeBuildUpload GraphQL mutations; the build token is sent as X-MafiaHub-Build-Token only to that endpoint and is never forwarded to presigned upload URLs.

The CLI build regenerates apps/api/schema.graphql from the NestJS code-first resolvers, then uses GraphQL Code Generator to produce typed documents in src/generated/graphql.ts. Schema drift therefore fails during code generation or TypeScript compilation instead of at runtime.

Publish a generated static scripting documentation bundle:

mafiahub-services docs publish \
    --api-url https://api.example.com \
    --mod-id 00000000-0000-0000-0000-000000000000 \
    --channel stable \
    --version 1.0.0 \
    --root ./build/docs/m2o

Set MAFIAHUB_DOCS_UPLOAD_TOKEN in CI. Documentation credentials are scoped separately from binary build uploads.