Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@frontmcp/di

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@frontmcp/di

Generic dependency injection container and registry utilities for TypeScript applications

Source
npmnpm
Version
1.3.0
Version published
Weekly downloads
2.8K
-25.55%
Maintainers
1
Weekly downloads
 
Created
Source

@frontmcp/di

Dependency injection container and registry utilities for FrontMCP.

NPM

Internal package. Used by @frontmcp/sdk — most users do not need to install this directly.

Install

npm install @frontmcp/di reflect-metadata zod

Features

  • Type-safe DI — class tokens with configurable prefixes (docs)
  • Scoped providers — GLOBAL and CONTEXT scopes
  • Hierarchical registries — parent/child container adoption
  • Indexed lookups — O(1) registry queries via IndexedRegistry
  • Change events — subscribe to registry mutations
  • Token factorycreateTokenFactory({ prefix }) for Symbol-based tokens

Quick Example

import 'reflect-metadata';
import { DiContainer, createTokenFactory, ProviderScope } from '@frontmcp/di';

const tokens = createTokenFactory({ prefix: 'MyApp' });

class DatabaseService {
  static metadata = { name: 'Database', scope: ProviderScope.GLOBAL };
}

const container = new DiContainer([DatabaseService]);
await container.ready;
const db = container.get(DatabaseService);

Docs

TopicLink
Providers & DIProviders

License

Apache-2.0 — see LICENSE.

Keywords

dependency-injection

FAQs

Package last updated on 27 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts