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

ui-strings

v0.1.5

Published

Extract user-reachable UI strings from React (TS/TSX) codebases and generate JSON / Markdown / HTML reports

Readme

npm version npm downloads node version license

UI Strings Scanner

UI Strings Scanner lists every string that could reach the user in a React (JSX/TSX) codebase. It parses the AST with ts-morph instead of running the code, so one command covers any React project without a build step or a dev server. Detection relies on JSX semantics, so the scanner is React-only.

Use it to audit hardcoded copy, review tone and wording, catch untranslated strings, or take stock before adopting i18n. The scanner inventories strings and leaves translation-key management to your i18n tooling.

Quick Start

Run it at the root of your React project:

npx ui-strings scan
Scanning: /path/to/my-app/src/**/*.{ts,tsx,js,jsx}

214 strings (+18 internal) / 52 files scanned
  visible      163
  interactive  31
  internal     18
  a11y         14
  meta         6

→ /path/to/my-app/ui-strings-report/ui-strings.json
→ /path/to/my-app/ui-strings-report/ui-strings.md
→ /path/to/my-app/ui-strings-report/ui-strings.html

Review copy, then fix it with your AI agent

The HTML report doubles as a copy-review tool. Spot a string that needs work, click ✎, and type the new copy. The report shows old → new and keeps your edits across reloads.

Once your pass is done, Copy fix prompt turns every edit into one prompt with file:line locations. Paste it into Claude Code, Cursor, Codex, or any coding agent, and the agent rewrites the exact literals you marked.

Table view shows one row per string with surface, kind, context, and location columns. Rows copy out as TSV for spreadsheet work.

Features

  • Sentence-level extraction - <p>Hello <b>world</b>,<br />welcome</p> comes out as one string. Embedded expressions become {count} placeholders.
  • Condition tracking - Strings inside cond ? A : B or cond && X carry their condition, so you know when they show.
  • Symbol resolution - An option array rendered with .map() links back to its declaration, across import chains and @/ aliases.
  • Surface classification - Every string carries a tag for how it reaches the user: visible (rendered as-is), interactive (toasts, validation, API messages), a11y (aria-*, alt, title), meta (Next.js metadata), or internal (console/throw).
  • Noise filtering - Class names, import paths, and directives never make the list. Detection combines a string's position (attribute, object key, call argument) with its shape, and treats non-Latin text as copy in any position, so mixed-language projects work.
  • Next.js aware - Entries group by App Router route, and metadata lands under meta.
  • Fix prompts - Edit strings in the HTML viewer, then copy all edits as a ready-to-run prompt for an AI coding agent.

Usage

npx ui-strings scan [projectDir] [options]

projectDir defaults to the current directory.

| Option | Default | Description | | -------------------- | -------------------------- | -------------------------------------------------------------------------------------------------------------- | | --src <glob> | src/**/*.{ts,tsx,js,jsx} | files to scan (relative to projectDir) | | --exclude <globs> | none | extra exclude globs, comma-separated (*.test.* / *.spec.* / __tests__ / __mocks__ are always excluded) | | --out <dir> | ./ui-strings-report | output directory | | --format <list> | json,md,html | output formats | | --include-internal | off | include console/throw strings in the Markdown listing | | --open | off | open the HTML report in a browser |

The scanner reads the target project's tsconfig.json when present and resolves path aliases such as @/* through it.

Output

  • ui-strings.json - every entry with text, file, line, kind, surface, and condition
  • ui-strings.md - counts by surface, kind, and group, plus the full listing
  • ui-strings.html - single-file viewer with search, filters, TSV row copy, and inline editing

Limitations

Strings built at runtime, such as API responses and computed values, stay invisible to static analysis. The scanner records copy passed across components at its declaration and resolves render sites only for the array .map() pattern. Unknown copy attributes fall back to lexical detection.

Development

The published CLI runs on Node. Development uses Bun.

bun install
bun test
bun run typecheck
bun run build   # bundle dist/cli.js

To try a local build in another React project without publishing:

bun run build
npm link
# In another React project
ui-strings scan

Contributing

Issues and pull requests are welcome.

License

MIT

Author

Junsei Nagao https://github.com/junseinagao