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

@elliemae/cold-start-library

v26.3.0

Published

ICE MT Platform UI Monorepo Library - cold-start (cache warming, asset preloading, idle scheduling)

Downloads

185

Readme

Cold Start Library

@elliemae/cold-start-library prefetches micro-app assets during browser idle time to warm the HTTP cache. It fetches each app's manifest.json, discovers JS and CSS assets, and injects <link rel="preload"> tags so subsequent navigations load instantly.

How It Works

  1. You register micro-app entries with CacheWarmer, providing the origin, base path, and version.
  2. The library waits for the browser to become idle (requestIdleCallback).
  3. It fetches {url}/{basePath}/{version}/manifest.json and identifies JS/CSS assets.
  4. <link rel="preload"> tags are injected into <head> during idle time, warming the browser cache.
  5. Subsequent navigations to those micro-apps load assets from cache.

Installation

pnpm add @elliemae/cold-start-library

Quick Start

import { CacheWarmer } from '@elliemae/cold-start-library';

const warmer = new CacheWarmer();

warmer.register([
  {
    key: 'dashboard',
    url: 'https://app.example.com',
    basePath: 'dashboard-app',
    version: '1.0',
  },
  {
    key: 'settings',
    url: 'https://app.example.com',
    basePath: 'settings-app',
    version: '2.1',
    autoTrigger: false,
  },
]);

// dashboard starts loading immediately during idle time.
// settings waits until you explicitly trigger it:
warmer.trigger('settings');

// Check the result of a prefetch:
const result = await warmer.getResult('dashboard');
console.log(result.status); // 'success' | 'error' | 'timeout'
console.log(result.preloadedAssets); // ['https://...app.abc123.js', ...]

// Clean up when done:
warmer.dispose();

Selective Asset Preloading

Use assetFilter to preload only specific assets from the manifest instead of everything. Pass the manifest keys you want:

warmer.register([
  {
    key: 'fee-itemization',
    url: 'https://encompass.q3.ice.com',
    basePath: 'em-web-forms',
    version: '26.2',
    assetFilter: ['app.js', 'vendors.js', 'main.css'],
  },
]);

Only assets whose manifest key is in the list will be preloaded. When assetFilter is omitted, all JS and CSS assets from the manifest are preloaded.

API

new CacheWarmer()

Creates a new CacheWarmer instance.


register(entries: IPrefetchEntry[]): void

Registers micro-app entries for prefetching.

  • Entries with autoTrigger: true (default) begin loading on the next browser idle.
  • Entries with autoTrigger: false wait until trigger(key) is called.
  • Throws if a duplicate key is registered.

trigger(key: string): void

Manually triggers a deferred entry by its key, starting the prefetch.

  • Throws if key is not registered.
  • Throws if key has already been triggered.

getResult(key: string): Promise<IPrefetchResult>

Returns a promise that resolves with the prefetch result for the given key.

  • Throws if key is not registered.

isTriggered(key: string): boolean

Returns whether the entry for the given key has been triggered.

  • Throws if key is not registered.

dispose(): void

Disposes the instance, cleaning up all internal resources (preload links, idle callbacks). After disposal, all public methods will throw. Safe to call multiple times.


isDisposed: boolean

Whether the instance has been disposed.

Types

IPrefetchEntry

interface IPrefetchEntry {
  key: string; // Unique identifier for this entry
  url: string; // Origin URL, e.g. "https://encompass.q3.ice.com"
  basePath: string; // Base path of the micro-app, e.g. "em-web-forms"
  version: string; // App version, used to build the manifest URL
  autoTrigger?: boolean; // Start loading on idle (default: true)
  assetFilter?: string[]; // Only preload these manifest keys
}

The manifest URL is derived as {url}/{basePath}/{version}/manifest.json.

IPrefetchResult

interface IPrefetchResult {
  url: string; // The origin URL
  key: string; // The entry key
  status: 'success' | 'error' | 'timeout'; // Outcome
  duration: number; // Time in milliseconds
  preloadedAssets?: string[]; // Asset URLs that were discovered and preloaded
}

Debug Logging

Enable verbose console logging by setting the following in the browser console:

window.cacheWarmerDebug = true;

Running Tests

pnpm test

Runs Playwright E2E tests against real browsers. Tests run in Chromium and Firefox on all platforms, with WebKit (Safari) on macOS.