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

@belov.ai/source-to-llm

v0.0.1

Published

Extract source code from files and format it for LLM context/prompt

Readme

source-to-llm

A lightweight CLI tool that extracts source code from your project files and formats it for use in LLM prompts. Perfect for preparing your codebase for AI analysis, code review, or documentation tasks.

Usage

The easiest way to use this tool is with npx:

# Basic usage - will process .ts, .js, .tsx, .jsx files in current directory
npx @belov.ai/source-to-llm

# Process specific file types
npx @belov.ai/source-to-llm -p "**/*.py" "**/*.java"

# Process specific directory
npx @belov.ai/source-to-llm -d /path/to/your/project

# Exclude specific patterns
npx @belov.ai/source-to-llm -i "**/tests/**" "**/vendor/**"

# Use custom separator between files
npx @belov.ai/source-to-llm -s "===="

Options

  • -p, --pattern <patterns...> - File patterns to match (default: ["**/*.ts", "**/*.js", "**/*.tsx", "**/*.jsx"])
  • -i, --ignore <patterns...> - Patterns to ignore (default: ["**/node_modules/**", "**/dist/**", "**/build/**"])
  • -s, --separator <string> - Separator between files (default: 80 dashes)
  • -d, --dir <path> - Target directory path (default: current working directory)

Example Output

File: src/components/Button.tsx
--------------------------------------------------------------------------------
import React from 'react';

export const Button = ({ children }) => {
  return <button>{children}</button>;
};
--------------------------------------------------------------------------------

File: src/utils/format.ts
--------------------------------------------------------------------------------
export const formatDate = (date: Date): string => {
  return date.toISOString();
};
--------------------------------------------------------------------------------

Common Use Cases

  1. AI Code Review

    npx @belov.ai/source-to-llm -p "src/**/*.ts" > code-for-review.txt
  2. Documentation Generation

    # Extract all component files
    npx @belov.ai/source-to-llm -p "src/components/**/*.[tj]sx" > components.txt
  3. Focused Analysis

    # Extract specific features or modules
    npx @belov.ai/source-to-llm -p "src/features/auth/**/*.ts" -i "**/*.test.ts"
  4. Multi-Language Projects

    # Process multiple file types
    npx @belov.ai/source-to-llm -p "**/*.py" "**/*.ts" "**/*.go"

Requirements

  • Node.js >= 18.0.0

License

MIT

Author

belov.ai