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

@angular-modernizer/worker

v0.1.3

Published

Worker thread script for parallel analysis in the Angular Modernization Platform

Readme

@angular-modernizer/worker

Worker thread script for parallel analysis in the Angular Modernization Platform.

Overview

This package contains the analysis worker script that runs in Node.js worker threads for parallel code analysis. It depends on all plugin packages and is therefore the last package built in the monorepo.

Why a Separate Package?

Worker threads run in isolated V8 contexts and need access to all analysis plugins. Since plugins depend on core, and core contains the WorkerPool, placing the worker script in core would create a circular dependency.

This package resolves that by:

  1. Depending on all plugin packages (builds last)
  2. Exporting a helper function to get the worker script path
  3. Being used by both programmatic API users and the MCP adapter

Usage

import { getWorkerScriptPath } from '@angular-modernizer/worker';
import { WorkerPool } from '@angular-modernizer/core';

const pool = new WorkerPool({
  tsConfigPath: '/path/to/tsconfig.json',
  workerScriptPath: getWorkerScriptPath(),
  maxWorkers: 4,
});

const result = await pool.executeTask({
  id: 'task-1',
  filePath: '/path/to/file.ts',
  pluginIds: ['architecture', 'solid'],
});

await pool.terminate();

Mode Selection

  • Less than 100 files: Promise mode (worker overhead exceeds benefit)
  • 100-500 files: Adaptive mode (auto-selects based on available memory)
  • More than 500 files: Worker mode (5-10x speedup)

Memory pressure: at 85% heap usage, the pool reduces worker count or pauses new tasks.

Build Order

This package builds last in the monorepo:

1. core
2. plugin-system
3. api
4. plugin-analyzer, plugin-solid, plugin-angular, plugin-standalone, plugin-architecture, orchestration
5. worker (this package)
6. adapter-mcp

Exports

  • getWorkerScriptPath() - Returns the absolute path to the compiled worker script
  • Re-exports WorkerTask, WorkerResult types from @angular-modernizer/core

Requirements

All workspace packages must be built before using workers. Run pnpm build from the monorepo root.

Testing

Worker tests are skipped by default to keep CI fast. Set ENABLE_WORKER_TESTS=true to run the full worker pool suite:

ENABLE_WORKER_TESTS=true pnpm --filter @angular-modernizer/worker test

Implementation Notes

Workers require ContextFactory.createAnalysisContext() — not a bare { sourceFile, project, config } object. Rules that access context.api will throw when given a bare object.

Data crossing the thread boundary must be JSON-serializable. Functions, class instances, circular references, and Symbols cannot be serialized and will cause DataCloneError.