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

@bimo-dk/nexus-runtime

v0.3.0

Published

Angular providers + services + components for Bimo-Nexus hosts and remotes

Readme

@bimo-dk/nexus-runtime

Angular providers for Bimo-Nexus remotes and hosts. Bundles runtime config, self-registration, HTTP interceptors and dynamic federation into one-call providers — so your bootstrap.ts stays focused on business logic.

Installation

npm install @bimo-dk/nexus-runtime @bimo-dk/nexus-build

Peer dependencies (must be installed in your app):

  • @angular/core, @angular/common, @angular/router (^19)
  • @angular-architects/native-federation (^19) — only required for hosts
  • rxjs (^7.8)

Remote (5-line bootstrap)

// src/bootstrap.ts
import { bootstrapApplication } from '@angular/platform-browser';
import { provideNexusRemote } from '@bimo-dk/nexus-runtime';
import EntryComponent from './app/remote-entry/entry.component';

bootstrapApplication(EntryComponent, {
  providers: [
    provideNexusRemote({
      entry: EntryComponent,
      configDefaults: {
        registryUrl: 'http://localhost:3000',
        nexusToken: 'dev-token',
      },
    }),
  ],
});
// src/app/remote-entry/entry.component.ts
import { Component } from '@angular/core';
import { NexusRemote } from '@bimo-dk/nexus-build';

@NexusRemote()                         // name & route auto-inferred
@Component({ template: '<h1>OK</h1>' })
export default class EntryComponent {}

At bootstrap:

  1. /assets/config.json is fetched and merged on top of configDefaults
  2. The remote POSTs itself to ${registryUrl}/remotes (or PUTs if already registered)
  3. Name/route/exposedModule are read from the @NexusRemote decorator metadata
  4. URL is derived from window.location (or publicUrl if set in runtime config)

Host (1 provider, full dynamic federation)

// src/bootstrap.ts
import { bootstrapApplication } from '@angular/platform-browser';
import { provideRouter } from '@angular/router';
import { provideNexusHost } from '@bimo-dk/nexus-runtime';
import { AppShell } from './app/app-shell.component';

bootstrapApplication(AppShell, {
  providers: [
    provideRouter([]),    // start with empty routes; nexus fills them in
    provideNexusHost({
      configDefaults: {
        registryUrl: '/api',
        nexusToken: 'dev-token',
        staticBackupUrl: '/assets/registry-backup/remotes.json',
      },
    }),
  ],
});

At bootstrap the host:

  1. Fetches enabled remotes from registry (with cache → static backup fallback chain)
  2. Opens a WebSocket to /ws for live updates
  3. Calls loadRemoteModule() for each remote, registers a route
  4. Reacts to WebSocket broadcasts to add/remove routes without reload

Read state from DynamicNexusService in your shell:

import { Component, inject } from '@angular/core';
import { DynamicNexusService } from '@bimo-dk/nexus-runtime';

@Component({ ... })
export class AppShell {
  readonly nexus = inject(DynamicNexusService);
  // nexus.loadedRemotes() — signal<RemoteConfig[]>
  // nexus.failedRemotes() — signal<Map<string, string>>
  // nexus.registryOnline() — computed signal
}

Runtime config (/assets/config.json)

Both providers fetch /assets/config.json at bootstrap. Typical template (substituted by nginx entrypoint at container start):

{
  "registryUrl": "${REGISTRY_URL}",
  "nexusToken": "${NEXUS_TOKEN}"
}

NexusRuntimeConfig fields:

| Field | Description | |---|---| | registryUrl | Base URL of the registry API | | nexusToken | Token for X-Nexus-Token header | | configAssetPath | Override /assets/config.json path | | publicUrl | Override the URL a remote announces to the registry | | staticBackupUrl | Host-only: path to the backup remotes JSON |

What's bundled

Both providers register the same baseline:

  • NEXUS_CONFIG injection token populated from runtime config
  • HttpClient with nexusAuthInterceptor + correlationIdInterceptor

Then they add their role-specific pieces:

  • RemoteSelfRegisterService runs once at bootstrap
  • HostRegistryService + RegistryWebSocketService + DynamicNexusService are started and route registration begins

Manual wiring (escape hatch)

If you need more control, all the building blocks are exported:

import {
  NEXUS_CONFIG,
  provideNexusConfig,
  SelfRegisterService,
  DynamicNexusService,
  RegistryService,
  RegistryWebSocketService,
  nexusAuthInterceptor,
  correlationIdInterceptor,
} from '@bimo-dk/nexus-runtime';