
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
component-to-route
Advanced tools
Traces a React component upward through the import/render graph to find all Next.js routes where it appears. Answers the question: **where should I go test this component?**
Traces a React component upward through the import/render graph to find all Next.js routes where it appears. Answers the question: where should I go test this component?
Useful after editing a shared component in a large app or monorepo — instead of guessing which routes to QA, you get a list with the file chain explaining how each route reaches the component.
The CLI performs static analysis on your codebase:
page.tsx, layout.tsx, etc.)Supports both App Router and Pages Router. Works on monorepos with workspace packages and tsconfig path aliases.
npx skills add sambernhardt/component-to-route
Once installed, the agent will automatically invoke component-to-route after editing components, and you can ask things like:
npm install -g component-to-route
Or without installing:
npx component-to-route <component-path>
component-to-route <component-path> [options]
Run from your workspace root. In a monorepo, use --dir to point at the Next.js app.
| Flag | Purpose |
|---|---|
--dir <path> | Directory of the Next.js app to search (defaults to cwd) |
--export <name> | Target a specific exported symbol, e.g. Button |
--json | Full JSON output for programmatic parsing |
--no-cache | Skip the local analysis cache |
--cache-dir <path> | Override the cache directory |
--no-build-artifacts | Skip .next manifest enrichment |
--dynamic-imports | Follow next/dynamic and React.lazy imports (slower) |
# Single-app repo
component-to-route src/components/button.tsx
# Target a specific named export
component-to-route src/components/button.tsx --export Button
# Monorepo: component lives in a package, app is in apps/web
component-to-route packages/design-system/src/components/badge/badge.tsx --dir apps/web
# component-to-route
> Badge from `packages/design-system/src/components/badge/badge.tsx`
> 3 routes found
## /docs (high)
-> app/docs/page.tsx
-> components/docs-page.tsx
-> packages/design-system/src/components/badge/badge.tsx
## /account (medium, shared layout)
-> app/account/layout.tsx
-> components/account-shell.tsx
-> components/status-chip.tsx
-> packages/design-system/src/components/badge/badge.tsx
## /settings (medium, shared layout)
-> app/settings/page.tsx
-> components/settings-panel.tsx
-> packages/design-system/src/components/badge/badge.tsx
Each route shows a confidence level and the file chain from route entrypoint down to the target component.
Confidence levels:
high — component is directly rendered in a page filemedium — reached via layout expansion or a thin wrapperlow — reached through re-exports, barrels, or dynamic patterns; still worth checking but may be a false positiveFAQs
Traces a React component upward through the import/render graph to find all Next.js routes where it appears. Answers the question: **where should I go test this component?**
The npm package component-to-route receives a total of 6 weekly downloads. As such, component-to-route popularity was classified as not popular.
We found that component-to-route demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.