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

@pandino/decorators

v0.10.0

Published

Decorators for the Pandino framework.

Readme

@pandino/decorators

npm version TypeScript License

TypeScript decorators for declarative service components in the Pandino framework. Annotate plain classes to describe services, dependencies, and lifecycle callbacks — the Pandino runtime takes care of wiring and activation.

Where it fits in the Pandino ecosystem

┌────────────────────────┐     ┌──────────────────────────┐     ┌────────────────────────┐
│ @pandino/decorators    │ ──▶ │ @pandino/pandino         │ ──▶ │ Your application       │
│ (declare components)   │     │ (Service Component       │     │ (discovers & uses      │
│                        │     │  Runtime activates them) │     │  services at runtime)  │
└────────────────────────┘     └──────────────────────────┘     └────────────────────────┘

Use this package whenever you want to define Pandino services declaratively, without writing manual registration code in a bundle activator. Decorator metadata is read by Pandino's Service Component Runtime (SCR) at runtime to create, activate, deactivate, and inject components automatically.

Installation

npm install @pandino/decorators reflect-metadata

reflect-metadata is a peer dependency. Import it once at the entry point of your application, before any decorated class is loaded:

import 'reflect-metadata';

TypeScript configuration

Enable experimental decorators and metadata emission in your tsconfig.json:

{
  "compilerOptions": {
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true
  }
}

Without these settings decorator metadata will not be emitted and Pandino will not be able to activate your components.

Available decorators

| Decorator | Target | Purpose | | -------------------------- | -------- | --------------------------------------------------------------------- | | @Component(options) | class | Declares a component with an optional name, lifecycle, and config PID | | @Service({ interfaces }) | class | Publishes the component as a service under one or more interfaces | | @Reference(options) | property | Injects a required or optional service dependency | | @Activate | method | Called when the component is activated | | @Deactivate | method | Called when the component is deactivated | | @Modified | method | Called when the component's configuration changes | | @Property(key, value) | class | Attaches a static property to the component | | @ConfigurationPolicy(p) | class | Sets configuration handling: optional, require, or ignore | | @Factory(factoryId) | class | Marks the component as a component factory | | @Immediate | class | Activates the component as soon as its dependencies are satisfied | | @Scope(scope) | class | Selects service scope: singleton, bundle, or prototype |

Basic usage

import { Component, Service, Reference, Activate, Deactivate } from '@pandino/decorators';
import type { LogService } from '@pandino/pandino';

interface GreetingService {
  sayHello(name: string): string;
}

@Component({ name: 'greeting.service', immediate: true })
@Service({ interfaces: ['GreetingService'] })
export class GreetingServiceImpl implements GreetingService {
  @Reference({ interface: 'LogService', cardinality: '1..1' })
  private logger!: LogService;

  @Activate
  activate(): void {
    this.logger.info('GreetingService activated');
  }

  @Deactivate
  deactivate(): void {
    this.logger.info('GreetingService deactivated');
  }

  sayHello(name: string): string {
    return `Hello, ${name}!`;
  }
}

This component will be discovered and registered automatically when placed in a Pandino bundle — no manual registerService() calls required.

How components reach the runtime

You typically don't register decorated classes yourself. Instead, one of the following mechanisms loads them into Pandino's SCR:

  • Bundles built with @pandino/rollup-bundle-plugin — the plugin scans your source files for @Component classes at build time and exposes them as a bundle module.
  • Manual bundle modules — add decorated classes to your bundle's components array.
  • Manual registration via ServiceComponentRuntime — for advanced cases where you need full control.

See the core framework README for details on bundles and the Service Component Runtime.

Related packages

License

Eclipse Public License - v 2.0