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 🙏

© 2025 – Pkg Stats / Ryan Hefner

fidx

v1.3.0

Published

Function Index - A tool that scans TypeScript/TSX files and lists function definitions

Downloads

17

Readme

fidx

Function Index /ˈfaɪ.dɛks/

A tool that scans TypeScript/TSX files and lists the locations of all function definitions.

Installation

Install globally:

npm i -g fidx

Or use directly with npx:

npx fidx <path>

You can also use yarn or pnpm as preferred.

Usage

fidx <path> [options]

Arguments

<path>
The directory or file you want to analyze for functions.

Options

--format <format>

Specifies the output format. Available formats:

grouped (default)
Displays results grouped by file paths.

auth/login.ts
  12 validateCredentials(credentials: { username: string; password: string; }): boolean
  29 generateToken(userId: string, options: { expiresIn: number }): { token: string }
  46 handleLoginRequest(request: { email: string; password: string; }): Promise<{ success: boolean }>

components/Button.tsx
   8 Button(props: { label: string }): ReactElement
  35 IconButton(props: { icon: string; label: string; }): ReactElement

utils/string.ts
   5 capitalize(str: string): string
  11 truncate(str: string, length: number): string
  24 sanitizeInput(input: string): string

list
Displays results in a single-line format.

path/to/auth/login.ts
   12 validateCredentials(credentials: { username: string; password: string; }): boolean
   29 generateToken(userId: string, options: { expiresIn: number }): { token: string }
   46 handleLoginRequest(request: { email: string; password: string; }): Promise<{ success: boolean }>

path/to/components/Button.tsx
    8 Button(props: { label: string }): ReactElement
   35 IconButton(props: { icon: string; label: string; }): ReactElement

path/to/utils/string.ts
    5 capitalize(str: string): string
   11 truncate(str: string, length: number): string
   24 sanitizeInput(input: string): string

tsv
Displays results in Tab-Separated Values format, suitable for importing into spreadsheets or processing with other tools.

path	line	name	parameters	returnType
path/to/auth/login.ts	12	validateCredentials	(credentials: { username: string; password: string; })	boolean
path/to/auth/login.ts	29	generateToken	(userId: string, options: { expiresIn: number })	{ token: string }
path/to/auth/login.ts	46	handleLoginRequest	(request: { email: string; password: string; })	Promise<{ success: boolean }>
path/to/components/Button.tsx	8	Button	(props: { label: string })	ReactElement
path/to/components/Button.tsx	35	IconButton	(props: { icon: string; label: string; })	ReactElement
path/to/utils/string.ts	5	capitalize	(str: string)	string
path/to/utils/string.ts	11	truncate	(str: string, length: number)	string
path/to/utils/string.ts	24	sanitizeInput	(input: string)	string

json
Displays results in JSON format, suitable for processing with tools like jq. Each file is represented as an object containing its path and an array of functions.

[
  {
    "path": "auth/login.ts",
    "functions": [
      {
        "line": 12,
        "name": "validateCredentials",
        "parameters": [
          {
            "name": "credentials",
            "type": "{ username: string; password: string; }"
          }
        ],
        "returnType": "boolean"
      },
      {
        "line": 29,
        "name": "generateToken",
        "parameters": [
          {
            "name": "userId",
            "type": "string"
          },
          {
            "name": "options",
            "type": "{ expiresIn: number }"
          }
        ],
        "returnType": "{ token: string }"
      },
      {
        "line": 46,
        "name": "handleLoginRequest",
        "parameters": [
          {
            "name": "request",
            "type": "{ email: string; password: string; }"
          }
        ],
        "returnType": "Promise<{ success: boolean }>"
      }
    ]
  },
  {
    "path": "components/Button.tsx",
    "functions": [
      {
        "line": 8,
        "name": "Button",
        "parameters": [
          {
            "name": "props",
            "type": "{ label: string }"
          }
        ],
        "returnType": "ReactElement"
      },
      {
        "line": 35,
        "name": "IconButton",
        "parameters": [
          {
            "name": "props",
            "type": "{ icon: string; label: string; }"
          }
        ],
        "returnType": "ReactElement"
      }
    ]
  },
  {
    "path": "utils/string.ts",
    "functions": [
      {
        "line": 5,
        "name": "capitalize",
        "parameters": [
          {
            "name": "str",
            "type": "string"
          }
        ],
        "returnType": "string"
      },
      {
        "line": 11,
        "name": "truncate",
        "parameters": [
          {
            "name": "str",
            "type": "string"
          },
          {
            "name": "length",
            "type": "number"
          }
        ],
        "returnType": "string"
      },
      {
        "line": 24,
        "name": "sanitizeInput",
        "parameters": [
          {
            "name": "input",
            "type": "string"
          }
        ],
        "returnType": "string"
      }
    ]
  }
]

--absolute

Displays absolute file paths instead of relative paths from the target directory. When not specified, relative paths are displayed.

--version, -V

Displays the current version of fidx.

--help, -h

Display help for command.

Requirements

  • Node.js 22 or higher

License

MIT License - see the LICENSE file for details.

Copyright (c) 2025 Crescware Inc.