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

@ff-labs/bun

v0.1.37

Published

High-performance fuzzy file finder for Bun - perfect for LLM agent tools

Downloads

636

Readme

fff - Fast File Finder

High-performance fuzzy file finder for Bun, powered by Rust. Perfect for LLM agent tools that need to search through codebases.

Features

  • Blazing fast - Rust-powered fuzzy search with parallel processing
  • Smart ranking - Frecency-based scoring (frequency + recency)
  • Git-aware - Shows file git status in results
  • Query history - Learns from your search patterns
  • Type-safe - Full TypeScript support with Result types

Installation

bun add fff

The native binary will be downloaded automatically during installation.

Quick Start

import { FileFinder } from "fff";

// Initialize with a directory
const result = FileFinder.init({ basePath: "/path/to/project" });
if (!result.ok) {
  console.error(result.error);
  process.exit(1);
}

// Wait for initial scan
FileFinder.waitForScan(5000);

// Search for files
const search = FileFinder.search("main.ts");
if (search.ok) {
  for (const item of search.value.items) {
    console.log(item.relativePath);
  }
}

// Cleanup when done
FileFinder.destroy();

API Reference

FileFinder.init(options)

Initialize the file finder.

interface InitOptions {
  basePath: string;           // Directory to index (required)
  frecencyDbPath?: string;    // Frecency DB path (omit to skip frecency)
  historyDbPath?: string;     // History DB path (omit to skip query tracking)
  useUnsafeNoLock?: boolean;  // Faster but less safe DB mode
}

const result = FileFinder.init({ basePath: "/my/project" });

FileFinder.search(query, options?)

Search for files.

interface SearchOptions {
  maxThreads?: number;          // Parallel threads (0 = auto)
  currentFile?: string;         // Deprioritize this file
  comboBoostMultiplier?: number; // Query history boost
  minComboCount?: number;        // Min history matches
  pageIndex?: number;            // Pagination offset
  pageSize?: number;             // Results per page
}

const result = FileFinder.search("main.ts", { pageSize: 10 });
if (result.ok) {
  console.log(`Found ${result.value.totalMatched} files`);
}

Query Syntax

  • foo bar - Match files containing "foo" and "bar"
  • src/ - Match files in src directory
  • file.ts:42 - Match file.ts with line 42
  • file.ts:42:10 - Match with line and column

FileFinder.trackAccess(filePath)

Track file access for frecency scoring.

// Call when user opens a file
FileFinder.trackAccess("/path/to/file.ts");

FileFinder.trackQuery(query, selectedFile)

Track query completion for smart suggestions.

// Call when user selects a file from search
FileFinder.trackQuery("main", "/path/to/main.ts");

FileFinder.healthCheck(testPath?)

Get diagnostic information.

const health = FileFinder.healthCheck();
if (health.ok) {
  console.log(`Version: ${health.value.version}`);
  console.log(`Indexed: ${health.value.filePicker.indexedFiles} files`);
}

Other Methods

  • FileFinder.scanFiles() - Trigger rescan
  • FileFinder.isScanning() - Check scan status
  • FileFinder.getScanProgress() - Get scan progress
  • FileFinder.waitForScan(timeoutMs) - Wait for scan
  • FileFinder.reindex(newPath) - Change indexed directory
  • FileFinder.refreshGitStatus() - Refresh git cache
  • FileFinder.getHistoricalQuery(offset) - Get past queries
  • FileFinder.shortenPath(path, maxSize, strategy) - Shorten paths
  • FileFinder.destroy() - Cleanup resources

Result Types

All methods return a Result<T> type for explicit error handling:

type Result<T> = 
  | { ok: true; value: T }
  | { ok: false; error: string };

const result = FileFinder.search("foo");
if (result.ok) {
  // result.value is SearchResult
} else {
  // result.error is string
}

Search Result Types

interface SearchResult {
  items: FileItem[];
  scores: Score[];
  totalMatched: number;
  totalFiles: number;
  location?: Location;
}

interface FileItem {
  path: string;
  relativePath: string;
  fileName: string;
  size: number;
  modified: number;
  gitStatus: string; // 'clean', 'modified', 'untracked', etc.
}

Building from Source

If prebuilt binaries aren't available for your platform:

# Clone the repository
git clone https://github.com/dmtrKovalenko/fff.nvim
cd fff.nvim

# Build the C library
cargo build --release -p fff-c

# The binary will be at target/release/libfff_c.{so,dylib,dll}

CLI Tools

# Download binary manually
bunx fff download [version]

# Show platform info
bunx fff info

License

MIT