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

@owll/func-spy

v1.0.2

Published

A JavaScript/TypeScript analysis tool to find function references and call sites using AST.

Readme

@owll/func-spy

A JavaScript/TypeScript analysis tool to find function references and call sites using AST (Abstract Syntax Tree). This CLI tool helps you analyze the usage of a function throughout your codebase by parsing JavaScript or TypeScript files.

Features

  • Identify function calls and references within a JavaScript or TypeScript file.
  • Support for ECMAScript versions from 2015 (ES6) to the current year.
  • Easily integrates into your development workflow to help with refactoring and debugging.

Installation

You can install the package globally or use it directly via npx.

Option 1: Install globally

npm install -g @owll/func-spy

Option 2: Install globally

npx @owll/func-spy path/to/your/file.js functionName

Usage

After installation, you can use the command line tool to analyze the usage of a specific function in a JavaScript or TypeScript file.

func-spy <file-path> <function-name>

<file-path>: The path to the JavaScript or TypeScript file you want to analyze.

<function-name>: The name of the function whose references and calls you want to find.

Example

To analyze a function named startGame in a file called game.js:

npx @owll/func-spy game.js startGame

This will analyze the game.js file and search for all occurrences of the startGame function.

Output

The tool will output a JSON object with details about the function calls and references found in the file. The output will look like this:

{
  "calls": [
    {
      "line": 10,
      "arguments": ["literal_argument", "Identifier(player)"]
    },
    {
      "line": 25,
      "arguments": ["Identifier(gameId)", "literal_argument"]
    }
  ],
  "references": [
    {
      "line": 5,
      "column": 15
    },
    {
      "line": 18,
      "column": 7
    }
  ]
}

Output Explanation:

calls: An array of function calls where the function is called in the file.

line: The line number where the function call occurs.

arguments: An array of arguments passed to the function, showing either the literal value or the identifier used.

references: An array of references to the function, showing where the function is referenced without being called.

line: The line number where the reference occurs.

column: The column number where the reference occurs in the line.

Supported ECMAScript Versions

The tool supports ECMAScript versions from 2015 (ES6) to the current year. The parser will try parsing with different ECMAScript versions starting from the latest supported version and fall back to previous versions if parsing fails.

Support

For support, you can reach out via Buy Me A Coffee.

License

This project is licensed under the MIT License.