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

@travetto/registry

v7.1.4

Published

Patterns and utilities for handling registration of metadata and functionality for run-time use

Readme

Registry

Patterns and utilities for handling registration of metadata and functionality for run-time use

Install: @travetto/registry

npm install @travetto/registry

# or

yarn add @travetto/registry

This module is the backbone for all "discovered" and "registered" behaviors within the framework. This is primarily used for building modules within the framework and not directly useful for application development.

Flows

Registration, within the framework flows throw two main use cases:

Initial Flows

The primary flow occurs on initialization of the application. At that point, the module will:

  1. Initialize Registry and will automatically register/load all relevant files
  2. As files are imported, decorators within the files will record various metadata relevant to the respective registries
  3. When all files are processed, the Registry is finished, and it will signal to anything waiting on registered data that its free to use it.

This flow ensures all files are loaded and processed before application starts. A sample registry could like:

Code: Sample Registry

import type { Class } from '@travetto/runtime';
import { type RegistryAdapter, type RegistryIndex, RegistryIndexStore, Registry } from '@travetto/registry';

interface Group {
  class: Class;
  name: string;
  children: Child[];
}

interface Child {
  name: string;
  method: Function;
}

/**
 * The adapter to handle mapping/modeling a specific class
 */
class SampleRegistryAdapter implements RegistryAdapter<Group> {

  #class: Class;
  #config: Group;

  constructor(cls: Class) {
    this.#class = cls;
  }

  register(...groups: Partial<Partial<Group>>[]): Group {
    for (const group of groups) {
      Object.assign(this.#config, {
        ...group,
        children: [
          ...(this.#config?.children ?? []),
          ...(group.children ?? [])
        ]
      });
    }
    return this.#config;
  }

  registerChild(method: Function, name: string): void {
    this.register({ children: [{ method, name }] });
  }

  finalize?(parent?: Partial<Group> | undefined): void {
    // Nothing to do
  }

  get(): Group {
    return this.#config;
  }
}

/**
 * Basic Index that handles cross-class activity
 */
export class SampleRegistryIndex implements RegistryIndex {
  static #instance = Registry.registerIndex(SampleRegistryIndex);

  static getForRegister(cls: Class, allowFinalized = false): SampleRegistryAdapter {
    return this.#instance.store.getForRegister(cls, allowFinalized);
  }

  store = new RegistryIndexStore(SampleRegistryAdapter);

  onCreate(cls: Class): void {
    // Nothing to do
  }
}

The registry index is a RegistryIndex that similar to the Schema's Schema registry and Dependency Injection's Dependency registry.

Live Flow

At runtime, the framework is designed to listen for changes and restart any running processes as needed.