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

@interopio/ng

v6.3.0

Published

IO Connect library for Angular - Browser and Desktop

Readme

@interopio/ng

Overview

The @interopio/ng library is a lightweight wrapper for the io.Connect JavaScript libraries - @interopio/desktop for io.Connect Desktop projects, and @interopio/browser and @interopio/browser-platform for io.Connect Browser projects. It provides custom functions, modules, and services that can be used to initialize the io.Connect libraries and access the io.Connect APIs in your Angular apps.

Installation

To install the library, execute the following command:

npm install @interopio/ng

Usage

The following examples demonstrate basic initialization of the @interopio/ng library in io.Connect Desktop and io.Connect Browser Angular apps that use standalone components.

ℹ️ For more details on using the @interopio/ng library and the io.Connect APIs in io.Connect Desktop projects, see the io.Connect Desktop official documentation.

ℹ️ For more details on using the @interopio/ng library and the io.Connect APIs in io.Connect Browser projects, see the io.Connect Browser official documentation.

io.Connect Desktop

In app.config.ts of the app:

import { ApplicationConfig } from "@angular/core";
import { provideIoConnect } from "@interopio/ng";
import IODesktop, { IOConnectDesktop } from "@interopio/desktop";

const config: IOConnectDesktop.Config = {
    // Optional Browser Client configuration.
};

export const appConfig: ApplicationConfig = {
    providers: [
        provideIoConnect({
            desktop: {
                factory: IODesktop,
                config
            }
        })
    ]
};

In main.ts of the app:

import { bootstrapApplication } from "@angular/platform-browser";
import { appConfig } from "./app/app.config";
import { App } from "./app/app";

bootstrapApplication(App, appConfig);

io.Connect Browser

Main App

In app.config.ts of the Main app:

import { ApplicationConfig } from "@angular/core";
import { provideIoConnect } from "@interopio/ng";
import IOBrowserPlatform, { IOConnectBrowserPlatform } from "@interopio/browser-platform";

// Main app configuration.
const config: IOConnectBrowserPlatform.Config = {
    licenseKey: "my-license-key"
};

export const appConfig: ApplicationConfig = {
    providers: [
        provideIoConnect({
            browserPlatform: {
                factory: IOBrowserPlatform,
                config
            }
        })
    ]
};

In main.ts of the Main app:

import { bootstrapApplication } from "@angular/platform-browser";
import { appConfig } from "./app/app.config";
import { App } from "./app/app";

bootstrapApplication(App, appConfig);

Browser Client

In app.config.ts of the Browser Client:

import { ApplicationConfig } from "@angular/core";
import { provideIoConnect } from "@interopio/ng";
import IOBrowser, { IOConnectBrowser } from "@interopio/browser";

const config: IOConnectBrowser.Config = {
    // Optional Browser Client configuration.
};

export const appConfig: ApplicationConfig = {
    providers: [
        provideIoConnect({
            browser: {
                factory: IOBrowser,
                config
            }
        })
    ]
};

In main.ts of the Browser Client:

import { bootstrapApplication } from "@angular/platform-browser";
import { appConfig } from "./app/app.config";
import { App } from "./app/app";

bootstrapApplication(App, appConfig);

Testing

The package includes unit and integration tests.

Test Scripts

  • npm test - Runs all tests (unit + integration)
  • npm run test:unit - Runs only unit tests
  • npm run test:integration - Runs only integration tests

Test Structure

test/
├── globals.d.ts              # Global type declarations for Chai/Sinon
├── helpers/
│   └── utils.ts              # All test utilities (factories, mocks, window, async)
└── integration/              # Integration tests
    └── initialization.spec.ts
├── unit/                     # Unit tests
│   ├── glue-config.service.spec.ts
│   ├── glue-initializer.service.spec.ts
│   ├── glue-store.service.spec.ts
│   ├── ng.module.spec.ts
│   └── provide-io-connect.spec.ts

Test Coverage

The tests use Mocha, Chai, and Sinon, and run in a headless Chrome browser via Karma. Global type declarations allow using expect and sinon without imports in test files.

Unit Tests:

  • IOConnectConfigService - Configuration service that handles factory and config resolution, environment detection (desktop vs browser), settings merging, and config validation
  • IOConnectInitializer - Initialization service that manages the io.Connect factory invocation, error handling, timeout behavior, and holdInit functionality
  • IOConnectStore - State management service that provides reactive access to the io.Connect instance and initialization status via observables
  • IOConnectNg Module - Module configuration and dependency injection setup using forRoot()
  • provideIoConnect() - Standalone API for Angular 15+ that provides io.Connect services without modules

Integration Tests:

  • Initialization flow - Full integration tests covering both module-based (forRoot()) and standalone (provideIoConnect()) initialization flows across all three internally used libraries: @interopio/browser-platform, @interopio/browser, and @interopio/desktop.
  • Successful initialization - Verifies factory invocation, instance availability, and ready state emission
  • Error handling - Tests factory rejection, missing factory scenarios, and error propagation
  • Config flow - Validates config passing, window global fallbacks, and factory prioritization
  • holdInit behavior - Tests blocking vs non-blocking initialization modes
  • API equivalence - Ensures forRoot() and provideIoConnect() produce identical results