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

@module-federation/side-effect-scanner

v0.0.8

Published

## Quick Start

Downloads

114

Readme

@module-federation/side-effect-scanner

Quick Start

Installation

npm install @module-federation/side-effect-scanner

Usage Examples

Scan Built Artifacts (Recommended)

For complex projects, we recommend scanning the built artifacts directly to get the most accurate results.

npx se-scan --dir dist

Scan Entry Files and Dependencies

Specify the source entry file, and the tool will automatically compile its dependencies and identify side effects.

npx se-scan --entry src/index.ts

Use Complex Configuration

npx se-scan --entry src/index.ts --alias '{"@": "./src"}' --max-depth 5

Use Configuration File

npx se-scan --config .serc.ts

CLI Command Details

| Option | Description | Default | | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- | | -c, --config <path> | Configuration file path | .serc.ts | | -e, --entry <file> | Entry file path. When specified, scanning will start from this file and all its dependencies | index.ts | | -d, --dir <dir> | Specify the directory to scan. When set, all files in the directory will be scanned. Suitable for projects with complex build configurations, directly scanning artifacts for the most accurate results | - | | --max-depth <number> | Maximum dependency resolution depth | Infinity | | --alias <aliases> | Path alias configuration, formatted as JSON string, e.g., '{"@":"./src"}' | {} | | --compile | Whether to compile entry files | true | | -o, --output <path> | Output report filename | side-effect-report.md | | -f, --format <format> | Output format (md, json, console) | md | | --ignored-global-vars <vars> | Global variables to ignore, comma-separated | '' | | -i, --ignore <patterns> | File patterns to ignore, comma-separated | webpackChunk_* | | -u, --unknown-dir <dir> | Unknown directory shown in the report | dist | | -v, --verbose | Show detailed output | false | | --exclude-global-selector-after-class | Exclude global selectors after specified class names | true | | --exclude-important-rule | Exclude !important rules | true | | --high-risk-css-property | Whether to collect high-risk CSS properties, e.g., position: fixed | false | | --un-removed-event-listener | Whether to collect unremoved event listeners | true | | --anonymous-event-handler | Whether to collect anonymous event handler functions | true | | --dynamic-element-append | Whether to collect dynamic element append events: appendChild | false | | --dynamic-element-remove | Whether to collect dynamic element remove events: removeChild | false | | --dynamic-element-insert | Whether to collect dynamic element insert events: insertBefore | false | | --untracked-dynamic-element | Whether to collect other dynamic element events: createTextNode, innerHTML, outerHTML, insertAdjacentHTML | false | | --global-var-declaration | Whether to collect global variable declarations | true | | --built-in-override | Whether to collect built-in object overrides | true | | --critical-global-style | Whether to collect risky styles for global elements | true | | --global-selector | Whether to collect global selectors | true | | --complex-selector | Whether to collect style rules with complex selectors | false | | --important-declaration | Whether to collect style rules with !important declarations | false | | --duplicate-rule | Whether to collect duplicate style rules | true | | --global-style-side-effect | Whether to collect high-risk CSS properties, e.g., position: fixed | false |

Configuration Options

You can create a .serc.ts configuration file to customize scanning options.

Configuration options type:

interface ScanOptions {
  config?: string;
  entry?: string;
  dir?: string;
  output?: string;
  format?: 'console' | 'json' | 'md';
  ignore?: Array<string | { file: string; lines?: number[] }>;
  verbose?: boolean;
  maxDepth?: number;
  compile?: boolean;
  alias?: Record<string, string>;
  adapter?: string | [adapterPath: string, adapterOptions?: AdapterOptions];
  excludeGlobalSelectorAfterClass?: boolean;
  excludeImportantRule?: boolean;
  highRiskCssProperty?: boolean;
  ignoredGlobalVars?: string[];
  unRemovedEventListener?: boolean;
  anonymousEventHandler?: boolean;
  dynamicElementAppend?: boolean;
  dynamicElementRemove?: boolean;
  dynamicElementInsert?: boolean;
  untrackedDynamicElement?: boolean;
  globalVarDeclaration?: boolean;
  builtInOverride?: boolean;
  criticalGlobalStyle?: boolean;
  globalSelector?: boolean;
  complexSelector?: boolean;
  importantDeclaration?: boolean;
  duplicateRule?: boolean;
  globalStyleSideEffect?: boolean;
}

Output

After successful scanning, a side-effect-report.md file will be generated containing the scan results. The format is as follows:

More Information

View docs for more details.