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

@selfage/generator_cli

v4.4.12

Published

Code generation for message, service, and database.

Readme

@selfage/generator_cli

Turn a single YAML description into TypeScript code for data models, HTTP APIs, and Cloud Spanner schema.

Why use this CLI?

  • Describe enums, messages, service APIs, and database schema once and generate the boilerplate automatically.
  • Keep TypeScript types and runtime descriptors in sync without hand-editing multiple files.
  • Preview output with --dry-run, or run the generator in CI/CD with npx geneage.
  • Plays nicely with the @selfage/* runtime packages so the emitted code is executable right away.

Installation

npm install --save-dev @selfage/generator_cli

The binary is published as geneage. Invoke it with npx or wire it into a package.json script.

Quick start

  1. Write your definitions in YAML (the file must use the .yaml extension):

    - kind: Enum
      name: UserRole
      values:
        - { name: ADMIN, value: 1 }
        - { name: VIEWER, value: 2 }
    
    - kind: Message
      name: User
      fields:
        - { name: id, type: string, index: 1 }
        - { name: role, type: UserRole, index: 2 }
    
    - kind: Message
      name: GetUserRequest
      fields:
        - { name: id, type: string, index: 1 }
    
    - kind: Service
      name: UserService
      path: /user.v1.UserService
    
    - kind: RemoteCallsGroup
      name: UserClient
      service: UserService
      outputClient: ./generated/user_client
      outputHandler: ./generated/user_handlers
      calls:
        - name: GetUser
          path: /users/get
          body: GetUserRequest
          response: User
    
    - kind: SpannerDatabase
      name: UserDb
      outputDdl: ./generated/user_db_schema
      outputSql: ./generated/user_queries
      tables:
        - kind: Table
          name: UserTable
          columns:
            - { name: id, type: string }
            - { name: role, type: string }
          primaryKeys: [ id ]
  2. Run the generator from the directory that contains the definition file:

    npx geneage ./definition.yaml
  3. Review the emitted .ts and .json files in the target paths. Use --dry-run to print the generated content without touching the filesystem.

What gets generated?

  • Enum – TypeScript enums with an accompanying descriptor for @selfage/message.
  • Message – TypeScript interfaces with an accompanying descriptor for @selfage/message.
  • Service API – service API handler and client interfaces to be used together with @selfage/serivce_handler, @selfage/web_service_client, and @selfage/node_service_client.
  • Spanner Database – Cloud Spanner DDL JSON and strongly typed query helpers to be used with @google-cloud/spanner.

CLI reference

geneage [options] <definitionFile>

Options:

  • -V, --version – show the CLI version.
  • --dry-run – write the generated content to stdout instead of to disk.
  • -h, --help – display the usage guide.

The tool resolves <definitionFile> to <definitionFile>.yaml, so you can omit the .yaml suffix when convenient.

Examples

The test_data/generator/ directory contains end-to-end samples that cover every definition type. Use them as a reference when crafting your own YAML files.