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

showsignature

v0.1.8

Published

Extract structure from code. Turn source files into clean, readable artifacts.

Readme

showsignature

A CLI that extracts the useful structure from source files: signatures, imports, types, variables, comments, and Markdown sections.

Use it to understand a codebase quickly, review files, or create compact context for AI assistants.

Installation

Install locally or globally from the NPM registry

# global install
npm install -g showsignature

# local install
npm install showsignature
# All agents
npx skills add https://github.com/FredySandoval/showsignature --skill showsignature
# All agents
# install in pi
pi install npm:showsignature
pi install git:github.com/FredySandoval/showsignature
pi install https://github.com/FredySandoval/showsignature
git clone https://github.com/FredySandoval/showsignature.git
cd showsignature
pnpm install
pnpm build
pnpm link --global

Help

showsignature --help

Requires Node.js 18+.

Why?

Large files are noisy. showsignature gives you the shape of a project before you read the implementation:

  • What functions/classes exist?
  • What does each file import/export?
  • What types and interfaces define the data?
  • What headings/tables/code blocks exist in Markdown?

Usage

| Option | Description | | ------------------------ | ----------------------------------- | | --file <file> | Inspect one file. | | --folder <folder> | Inspect a folder. | | --stdin | Read source from stdin. | | --lang-only <lang> | Force language, useful with stdin. | | --show-only <items> | Choose extractors. | | --include-tests | Include test files in folder scans. | | --max-depth <n> | Limit folder scan depth. | | --ignore-folder <name> | Skip folders. |

Extractors

Code files:

| Mode | Shows | | ------------ | ------------------------------------------ | | signatures | Functions, classes, methods, constructors. | | imports | Import statements/declarations. | | exports | JS/TS exports, exported Go declarations, and Python public exports. | | interfaces | TypeScript/Go interfaces. | | types | Type aliases/declarations. | | variables | Variables/constants. | | comments | Code comments. |

JSX/TSX files:

| Mode | Shows | | ----------- | ------------------------------------------ | | html | JSX/HTML-like element and component structure. | | csshidden | Full file with noisy class, className, and style values collapsed. |

Markdown files:

| Mode | Shows | | --------------- | ------------------- | | md:headings | Headings. | | md:tables | Tables. | | md:codeblocks | Fenced code blocks. |

Supported files

| Language | Extensions | | ---------- | --------------------- | | TypeScript | .ts, .mts, .cts | | JavaScript | .js, .mjs, .cjs | | TSX/JSX | .tsx, .jsx | | Go | .go | | Python | .py | | Rust | .rs | | Lua | .lua | | Markdown | .md |

Basic usage examples

showsignature [--file <file> | --folder <folder> | --stdin] [options]
showsignature --help                                        # Show available options
showsignature --file src/01-main.ts                         # Inspect one file
showsignature --folder ./src                                # Inspect a folder
showsignature --folder .                                    # Inspect the current directory
cat src/01-main.ts | showsignature --stdin --lang-only ts   # Read TypeScript from stdin

showsignature --folder . --show-only imports                # Show imports only
showsignature --folder . --show-only exports                # Show exports only
showsignature --folder ./src --show-only signatures,imports # Show code structure and imports
showsignature --folder ./src --show-only imports,exports    # Show dependencies and public API
showsignature --folder ./src --show-only interfaces,types   # Show data shapes
showsignature --file src/01-main.ts --show-only variables   # Show variables
showsignature --file src/App.tsx --show-only html           # Show JSX/HTML-like component structure
showsignature --file src/App.tsx --show-only csshidden      # Show file with class/style noise hidden
showsignature --file src/App.tsx --show-only imports,exports,html # Combine TS/JS and JSX extractors

showsignature --file README.md --show-only md:headings      # Extract Markdown headings
showsignature --file README.md --show-only md:codeblocks    # Extract Markdown code blocks
showsignature --folder . --show-only md:tables              # Extract Markdown tables

showsignature --folder . --lang-only py                     # Process Python files only
showsignature --folder . --lang-only go --show-only imports,exports # Show Go imports and exported declarations
showsignature --folder . --lang-only py --show-only imports,exports # Show Python imports and public exports
showsignature --folder . --max-depth 2                      # Limit recursive scan depth
showsignature --folder . --ignore-folder dist               # Skip a noisy folder
showsignature --folder src --show-only signatures,imports > structure.txt # Save compact context

Combine modes with commas:

showsignature --folder src --show-only signatures,imports,comments

Output

showsignature prints compact text output. Use shell redirection to save output to a file:

showsignature --folder src --show-only signatures > structure.txt

Pipeline usage

showsignature writes to stdout by default, so it works well with tools like rg, grep, fzf, less, head, tee, and shell redirects.

showsignature --folder src | rg "function|class" # Search extracted structure with ripgrep
showsignature --folder src --show-only imports | rg "node:" # Find matching imports
showsignature --folder src --show-only signatures | rg "async" # Find async functions or methods
showsignature --folder src --show-only comments,signatures | rg -C 2 "ExtractKind" # Search comments/signatures with nearby context
showsignature --folder src --show-only signatures,imports | less # Page through large output
showsignature --folder src --show-only signatures | head -50 # Preview the first 50 lines
showsignature --folder src --show-only signatures,imports | tee structure.md # View and save output

Development

pnpm install
pnpm build
pnpm test
pnpm typecheck
pnpm format

Troubleshooting

  • Command not found? Use node dist/02-cli.js --help for local builds, or check your global npm bin path.
  • Folder scan empty? Supported files only are scanned; .gitignore is respected; tests are skipped unless --include-tests is set.
  • Stdin language unknown? Add --lang-only ts, --lang-only py, --lang-only go, or similar.

License

ISC. See LICENSE.