Introduction
While KafkaCode is primarily a CLI tool, it’s built with modular components that can be used programmatically in your Node.js applications.Architecture
KafkaCode consists of five main components:FileScanner
Discovers and filters source code files
PatternScanner
Regex-based pattern detection
LLMAnalyzer
AI-powered contextual analysis
AnalysisEngine
Orchestrates the scanning process
ReportGenerator
Generates formatted reports
Basic Usage
Installation
Import Syntax
- CommonJS
- ES Modules
Data Structures
Finding Object
Each finding has this structure:Quick Examples
Example 1: Simple Scan
Example 2: Custom Filtering
Example 3: Verbose Mode
Example 4: Single File Analysis
Example 5: Custom Report
Use Cases
Programmatic Scanning
Programmatic Scanning
Integrate KafkaCode into your build tools or scripts:
Custom Integrations
Custom Integrations
Build custom tools on top of KafkaCode:
API Server
API Server
Create a scanning API service:
Metrics Collection
Metrics Collection
Track privacy metrics over time:
Component Overview
| Component | Purpose | Key Methods |
|---|---|---|
| FileScanner | File discovery | scanFiles() |
| PatternScanner | Regex detection | scanContent() |
| LLMAnalyzer | AI analysis | analyzeFile() |
| AnalysisEngine | Orchestration | analyzeFile(), analyzeFiles() |
| ReportGenerator | Report formatting | generateReport() |

