# @travetto/registry

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

Latest version **8.0.1** (published 2026-09-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install @travetto/registry
pnpm add @travetto/registry
yarn add @travetto/registry
bun add @travetto/registry
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 8.0.1 |
| Published | 2026-09-05 |
| First published | 2017-10-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 23 |
| Author | Travetto Framework |
| Maintainers | arcsine |
| Keywords | ast-transformations, metadata, real-time, registry, travetto, typescript |

## Links

- npm: https://www.npmjs.com/package/@travetto/registry
- Repository: https://github.com/travetto/travetto
- Homepage: https://travetto.io
- Issues: https://github.com/travetto/travetto/issues
- npm.io page: https://npm.io/package/@travetto/registry

## Dependencies (1)

- [@travetto/runtime](https://npm.io/package/@travetto/runtime.md) ^8.0.1

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 8.0.1 (latest) — 2026-09-05
- 8.0.0-alpha.24 (alpha) — 2026-08-24
- 7.0.0-rc.5 (rc) — 2025-12-30
- 1.1.0-rc.0 (next) — 2020-09-20
- 1.0.0-beta.1 (beta) — 2019-08-16
- 8.0.0 — 2026-09-05
- 8.0.0-alpha.23 — 2026-08-24
- 8.0.0-alpha.22 — 2026-07-25
- 8.0.0-alpha.21 — 2026-07-25
- 8.0.0-alpha.20 — 2026-07-18
- 8.0.0-alpha.19 — 2026-07-12
- 8.0.0-alpha.18 — 2026-06-14
- 8.0.0-alpha.17 — 2026-06-13
- 8.0.0-alpha.16 — 2026-06-13
- 8.0.0-alpha.14 — 2026-04-17
- … 328 more at https://npm.io/package/@travetto/registry/versions

## README

<!-- This file was generated by @travetto/doc and should not be modified directly -->
<!-- Please modify https://github.com/travetto/travetto/tree/main/module/registry/DOC.tsx and execute "npx trv doc" to rebuild -->
# Registry

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

**Install: @travetto/registry**
```bash
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](https://github.com/travetto/travetto/tree/main/module/registry/src/registry.ts#L5) and will automatically register/load all relevant files
   1. As files are imported, decorators within the files will record various metadata relevant to the respective registries
   1. When all files are processed, the [Registry](https://github.com/travetto/travetto/tree/main/module/registry/src/registry.ts#L5) 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**
```typescript
import { Registry, type RegistryAdapter, type RegistryIndex, RegistryIndexStore } from '@travetto/registry';
import type { Class } from '@travetto/runtime';

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): SampleRegistryAdapter {
    return this.#instance.store.getForRegister(cls);
  }

  store = new RegistryIndexStore(SampleRegistryAdapter);

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

The registry index is a [RegistryIndex](https://github.com/travetto/travetto/tree/main/module/registry/src/types.ts#L32) that similar to the [Schema](https://github.com/travetto/travetto/tree/main/module/schema#readme "Data type registry for runtime validation, reflection and binding.")'s Schema registry and [Dependency Injection](https://github.com/travetto/travetto/tree/main/module/di#readme "Dependency registration/management and injection support.")'s Dependency registry.

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

---
_Source: https://npm.io/package/@travetto/registry · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
