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

@bernierllc/nevar-lifecycle-events

v0.1.0

Published

Typed lifecycle event emitter for observability hooks in the Nevar rules engine suite

Readme

@bernierllc/nevar-lifecycle-events

Typed lifecycle event emitter for observability hooks in the Nevar rules engine. Provides strongly-typed events for trigger processing, rule evaluation, action execution, and loop/circuit management.

Installation

npm install @bernierllc/nevar-lifecycle-events

Usage

import { NevarLifecycleEmitter } from '@bernierllc/nevar-lifecycle-events';

const lifecycle = new NevarLifecycleEmitter();

// Subscribe to rule match events
lifecycle.on('rule.matched', (payload) => {
  console.log('Rule matched:', payload);
});

// Subscribe to action failures
lifecycle.on('action.failed', (payload) => {
  console.error('Action failed:', payload);
});

// One-time listener for first loop detection
lifecycle.once('loop.detected', (payload) => {
  console.warn('Loop detected:', payload);
});

// Emit events from the engine pipeline
await lifecycle.emit('trigger.received', { triggerKey: 'user.created', payload: { email: '[email protected]' } });
await lifecycle.emit('rule.matched', { ruleId: 'rule-123', triggerKey: 'user.created' });

// Clean up
lifecycle.removeAllListeners();

API

NevarLifecycleEmitter

Typed event emitter wrapping @bernierllc/event-emitter with a focused API for Nevar lifecycle events.

  • on<T>(event: NevarLifecycleEventType, handler: LifecycleHandler<T>): void - Subscribe to a lifecycle event
  • off<T>(event: NevarLifecycleEventType, handler: LifecycleHandler<T>): void - Unsubscribe a handler
  • once<T>(event: NevarLifecycleEventType, handler: LifecycleHandler<T>): void - Subscribe for a single firing
  • emit<T>(event: NevarLifecycleEventType, payload: T): Promise<void> - Emit an event to all handlers
  • listenerCount(event: NevarLifecycleEventType): number - Get listener count for an event
  • removeAllListeners(event?: NevarLifecycleEventType): void - Remove listeners for one or all events

LIFECYCLE_EVENT_TYPES

Readonly array of all valid lifecycle event type strings, useful for validation and iteration:

trigger.received, trigger.invalid, context.built, rule.evaluating, rule.matched, rule.skipped, action.executing, action.executed, action.failed, action.retrying, chain.completed, loop.detected, loop.started, loop.heartbeat, loop.killed, circuit.tripped

NevarLifecycleError

Custom error class thrown when lifecycle event emission fails. Chains the original error via cause.

NevarLifecycleEventType (type)

Union type of all valid lifecycle event strings.

LifecycleHandler<T> (type)

Handler function signature: (payload: T) => void | Promise<void>.

Integration Documentation

Logger Integration

This package integrates with @bernierllc/logger for structured logging. Lifecycle event handlers can use logger to record observability data such as rule evaluation timings, action execution traces, and loop detection alerts.

NeverHub Integration

This package supports optional integration with @bernierllc/neverhub-adapter. When NeverHub is available, the lifecycle emitter can be registered for centralized event monitoring and cross-service observability. Graceful degradation is supported when NeverHub is not present.

License

Copyright (c) 2025 Bernier LLC. All rights reserved.