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

impacted

v0.0.8

Published

Find test files impacted by code changes using static dependency analysis

Readme

impacted

It takes a list of changed files, builds a dependency graph from your test files by statically analyzing their imports, and returns only the test files that depend on the changed files.

A userland implementation of predictive test selection for Node.js test runner.

npm version

Usage

# Run only impacted tests (--since gets changed files from git diff)
node --test $(npx impacted --since main)

# Pipe changed files from stdin
node --test $(git diff --name-only main | npx impacted)

# Works with any test runner
vitest $(npx impacted --since main)
jest $(npx impacted --since main)

# Custom test pattern
npx impacted --since main -p "src/**/*.spec.js"

# Multiple patterns
npx impacted --since main -p "test/**/*.test.js" -p "test/**/*.spec.js"

GitHub Action

- uses: actions/checkout@v4
  with:
    fetch-depth: 0

- uses: sozua/impacted@v1
  id: impacted
  with:
    pattern: '**/*.{test,spec}.{js,mjs,cjs,jsx,ts,mts,cts,tsx}'  # default

- name: Run impacted tests
  if: steps.impacted.outputs.has-impacted == 'true'
  run: node --test ${{ steps.impacted.outputs.files }}

See action.yml for all inputs and outputs.

Programmatic API

import { findImpacted } from 'impacted';

const tests = await findImpacted({
  changedFiles: ['src/utils.js'],
  testFiles: 'test/**/*.test.js',
  cacheFile: '.impacted-cache.json', // optional
});

node:test run() integration

import { run } from 'node:test';
import { findImpacted } from 'impacted';

const files = await findImpacted({
  changedFiles: ['src/utils.js'],
  testFiles: 'test/**/*.test.js',
});

run({ files });

See examples/05-node-test-run for a full working example.

TypeScript

TypeScript files (.ts, .mts, .cts, .tsx) are supported out of the box on Node.js >= 22.7. Type stripping is handled via node:module.stripTypeScriptTypes() — no additional dependencies required.

Follows Node.js core's TypeScript philosophy: explicit extensions, no tsconfig.json, no path aliases.

Limitations

  • Static analysis only — dynamic require(variable) not supported
  • Local files only — node_modules changes won't trigger tests
  • TypeScript support requires Node.js >= 22.7 (JS analysis works on Node.js >= 18)

Requirements

  • Node.js >= 18 (TypeScript support requires >= 22.7)

License

MIT