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

reflog

v0.0.4

Published

CLI tool to search for references in project files and log results

Readme

Reference Finder

A CLI tool that searches for references in your project and logs the results to a gitignored folder.

Installation

npm install -g reflog

Or locally in your project:

npm install reflog --save-dev

Usage

This tool provides two ways to use it - either through the unified reflog command or through direct commands.

Unified Command Interface

# Search for a single key
reflog search "database.host" --log

# Generate logs for all keys in a configuration
reflog generate --config=path/to/config.json

# Display help information
reflog --help

Direct Commands

Finding References for a Single Key

# Basic usage
find-references "database.host"

# Log the results to file
find-references "database.host" --log

# Specify directory to search
find-references "api.endpoint" --dir "./src"

Processing Multiple Keys from Configuration

# Process all keys from a configuration file
generate-conf-references --config=path/to/config.json

# Process keys from the default conf.json in logs folder
generate-conf-references

Configuration File

The tool uses a configuration file in JSON format to specify which keys to search for. Example structure:

{
  "database.host": "host",
  "api.endpoint": "endpoint",
  "auth.secret": "secret"
}

By default, the tool looks for conf.json in the logs folder. If the file doesn't exist, the tool will prompt you to create it.

Options

For single key searches (reflog search or find-references):

  • --help, -h: Display help information for the command
  • --log: Log the results to a file in the logs directory (name pattern: search_${value}_${occurrence}occ.log)
  • --dir, -d: Directory to search in (default: current directory)
  • --exclude, -e: Exclude pattern (glob) (default: node_modules/**)

For configuration-based searches (reflog generate or generate-conf-references):

  • --help, -h: Display help information for the command
  • --config=path/to/file.json: Specify a custom configuration file path

Programmatic Usage

You can also use the package programmatically:

const { findReferences } = require("reference-finder");

const results = findReferences({
  key: "database.host",
  dir: "./src",
  exclude: "node_modules/**,dist/**",
});

console.log(`Found ${results.totalMatches} matches for ${results.key}`);

Features

  • Unified CLI interface with intuitive subcommands
  • Searches for configuration key references in your codebase
  • Creates a logs directory (and adds it to .gitignore)
  • Generates detailed log files with matches
  • Shows progress with a visual progress bar when processing multiple keys
  • Can process multiple keys from a configuration file
  • Can be used both as a CLI and as a library

Examples

# Find all references to a specific API endpoint (unified interface)
reflog search "api.users.endpoint" --log

# Find all references to a specific API endpoint (direct command)
find-references "api.users.endpoint" --log

# Process all keys defined in the conf.json (unified interface)
reflog generate

# Process all keys defined in the conf.json (direct command)
generate-conf-references

# Use a custom configuration file (unified interface)
reflog generate --config=./my-config.json

# Use a custom configuration file (direct command)
generate-conf-references --config=./my-config.json

The unified interface (reflog) is recommended for new usage as it provides a more consistent experience.