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

fastv0

v1.0.0

Published

Fast File System Operations and AI Integration for Node.js - Like Cursor's token management

Downloads

8

Readme

FastV0

A powerful Node.js SDK for file system operations and AI integration, designed specifically for AI assistants and automation tools. Think of it as the Node.js equivalent of Cursor's token management and file operations.

Features

  • File Management: Read, write, and manage files with AI integration
  • Desktop Scanner: Scan and analyze desktop files across different operating systems
  • Token Management: Optimize AI context with token offloading/onloading (like Cursor)
  • AI Integration: Connect with multiple AI providers (OpenAI, Groq, Anthropic, Google)
  • Smart Caching: Intelligent caching system for file analysis and context management
  • TypeScript Support: Full TypeScript support with type definitions

Installation

npm install fastv0

Quick Start

Basic File Operations

import { FileManager } from 'fastv0';

const fm = new FileManager();

// Read a file
const result = await fm.readFile('example.js');
if (result.success) {
  console.log(`File content: ${result.content}`);
}

// Write a file
await fm.writeFile('output.txt', 'Hello, FastV0!');

// List files in directory
const files = await fm.listFiles('./', true);
console.log(`Found ${files.count} files`);

Desktop Scanning

import { DesktopScanner } from 'fastv0';

const scanner = new DesktopScanner();

// Scan desktop
const desktopInfo = await scanner.scanDesktop();
console.log(`Found ${desktopInfo.totalFiles} files on desktop`);

// Find specific files
const pythonFiles = await scanner.findDesktopFiles('.py');
console.log(`Found ${pythonFiles.totalFiles} Python files`);

// Analyze desktop structure
const analysis = await scanner.analyzeDesktopStructure();
console.log(`Desktop analysis:`, analysis.analysis);

Token Management (Cursor-like)

import { TokenManager } from 'fastv0';

const tm = new TokenManager();

// Offload context to save tokens
const context = { messages: [...], files: [...], analysis: [...] };
const offloadResult = await tm.offloadContext(context);
console.log(`Context offloaded: ${offloadResult.contextId}`);

// Load context back
const onloadResult = await tm.onloadContext(offloadResult.contextId!);
console.log(`Context loaded:`, onloadResult.context);

// Optimize context to fit token limits
const optimized = await tm.optimizeContext(context, 4000);
console.log(`Optimized: ${optimized.optimized}`);

AI Integration

import { AIIntegration } from 'fastv0';

// Initialize with API keys
const ai = new AIIntegration({
  groq: 'your-groq-api-key',
  openai: 'your-openai-api-key',
  anthropic: 'your-anthropic-api-key',
  google: 'your-google-api-key'
});

// Analyze file content
const analysis = await ai.analyzeFileContent(
  'function hello() { console.log("Hello, World!"); }',
  'javascript',
  'groq'
);
console.log(`Analysis: ${analysis.analysis}`);

// Generate file summary
const summary = await ai.generateFileSummary(
  'your code here...',
  'typescript'
);
console.log(`Summary: ${summary.analysis}`);

Complete Workflow

import { FastV0 } from 'fastv0';

const fastv0 = new FastV0({
  apiKeys: {
    groq: 'your-groq-api-key'
  }
});

// Run complete workflow
const result = await fastv0.completeWorkflow();
console.log(`Desktop scan: ${result.desktopScan?.totalFiles} files`);
console.log(`AI analyses: ${result.analyses?.length} files analyzed`);

CLI Tools

# Scan desktop
npx fastv0 scan

# Analyze a file
npx fastv0 analyze example.js
npx fastv0 analyze example.js --provider groq

# List files
npx fastv0 list ./src
npx fastv0 list ./src --recursive

# Search files
npx fastv0 search ./src "function"

# Cache operations
npx fastv0 cache info
npx fastv0 cache cleanup

# Complete workflow
npx fastv0 workflow

API Reference

FileManager

  • readFile(filePath, encoding?) - Read file content
  • writeFile(filePath, content, encoding?) - Write file content
  • listFiles(directory, recursive?, extensions?) - List files
  • searchFiles(directory, query, fileTypes?) - Search files
  • getFileInfo(filePath) - Get file metadata

DesktopScanner

  • scanDesktop(includeHidden?) - Scan desktop files
  • findDesktopFiles(extension?, nameContains?) - Find specific files
  • analyzeDesktopStructure() - Analyze desktop organization
  • getDesktopInfo() - Get desktop information

TokenManager

  • offloadContext(context, contextId?) - Save context to disk
  • onloadContext(contextId) - Load context from disk
  • optimizeContext(context, maxTokens?) - Optimize for token limits
  • manageConversationHistory(messages, maxMessages?) - Manage chat history
  • cacheFileAnalysis(filePath, analysis) - Cache analysis results
  • cleanupCache(maxAgeHours?) - Clean old cache files

AIIntegration

  • analyzeFileContent(content, fileType, provider?) - AI file analysis
  • generateFileSummary(content, fileType) - Generate file summary
  • suggestImprovements(content, fileType) - Suggest code improvements
  • detectCodeIssues(content, fileType) - Detect code issues
  • batchAnalyzeFiles(files, provider?) - Batch analysis

FastV0 (Main Class)

  • analyzeFile(filePath, provider?) - Quick file analysis
  • scanAndAnalyzeDesktop(provider?) - Scan and analyze desktop
  • optimizeAndCache(context, maxTokens?) - Optimize and cache context
  • completeWorkflow(provider?) - Run complete workflow

Configuration

Environment Variables

# API Keys
export GROQ_API_KEY="your-groq-key"
export OPENAI_API_KEY="your-openai-key"
export ANTHROPIC_API_KEY="your-anthropic-key"
export GOOGLE_API_KEY="your-google-key"

# Cache Directory
export FASTV0_CACHE_DIR="/path/to/cache"

Configuration Object

import { FastV0 } from 'fastv0';

const fastv0 = new FastV0({
  basePath: '/path/to/base',
  maxFileSize: 10 * 1024 * 1024, // 10MB
  maxTokens: 4000,
  apiKeys: {
    groq: 'your-groq-key',
    openai: 'your-openai-key',
    anthropic: 'your-anthropic-key',
    google: 'your-google-key'
  },
  cache: {
    enabled: true,
    maxAge: 24, // hours
    compression: true,
    directory: '/path/to/cache'
  }
});

Advanced Usage

Custom AI Provider

import { AIIntegration } from 'fastv0';

class CustomAIProvider extends AIIntegration {
  async analyzeFileContent(content: string, fileType: string, provider: string = 'custom') {
    // Your custom AI integration
    return {
      success: true,
      analysis: 'Custom analysis result',
      provider: 'custom',
      fileType: fileType,
      analyzedAt: new Date().toISOString()
    };
  }
}

Batch Processing

import { FileManager, AIIntegration } from 'fastv0';

const fm = new FileManager();
const ai = new AIIntegration({ groq: 'your-api-key' });

// Get all JavaScript files
const jsFiles = await fm.listFiles('./src', true, ['.js', '.ts']);

// Analyze all files
const analyses = [];
for (const file of jsFiles.files || []) {
  const content = await fm.readFile(file.path);
  if (content.success) {
    const analysis = await ai.analyzeFileContent(content.content!, file.extension);
    analyses.push({ file: file.path, analysis });
  }
}

console.log(`Analyzed ${analyses.length} files`);

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Support

Changelog

v1.0.0

  • Initial release
  • File management operations
  • Desktop scanning
  • Token management system
  • AI integration with multiple providers
  • Smart caching system
  • TypeScript support
  • CLI tools