Skip to content

Zero Hassle File Path Extraction & Analysis - Extract, validate, and analyze file paths from JavaScript, TypeScript, JSON, HTML, CSS, TOML, CSV, and ENV files. Smart package filtering, comprehensive validation, pattern recognition, and detailed reporting.

License

Notifications You must be signed in to change notification settings

OffensiveEdge/paths-le

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Paths-LE Logo

Paths-LE: Zero Hassle Path Extraction

Extract 10,000 paths in 0.3 seconds β€’ 50x faster than manual searching
JavaScript, TypeScript, JSON, HTML, CSS, TOML, CSV, and Environment files

Install from Open VSX Install from VS Code

12,436+ Downloads 4.5β˜… Rating 100% Open Source Zero Critical Vulnerabilities


Paths-LE Demo

Command Palette


⚑ See It In Action

Before: Manually searching through 500 lines for import paths (15 minutes)

import { Button } from './components/Button'
import { Header } from '../layout/Header'
// ... 50 more imports scattered across files

After: One command extracts all 52 paths in 0.3 seconds

./components/Button (line 1)
../layout/Header (line 2)
./utils/helpers (line 15)
... (52 paths total)

Time Saved: 15 minutes β†’ 1 second ⚑


βœ… Why Paths-LE?

  • 10,000 paths in 0.3 seconds - 50x faster than manual searching
  • Zero Config - Install β†’ Press Cmd+Alt+P β†’ Done
  • Battle-Tested - 289 unit tests, 93.55% coverage, zero critical vulnerabilities
  • Security-Hardened - 64 tests prevent path traversal, symlink exploits, injection attacks

Perfect for refactoring, dependency audits, and import analysis.


πŸ™ Thank You

If Paths-LE saves you time, a quick rating helps other developers discover it:
⭐ Open VSX β€’ VS Code Marketplace


Key Features

  • Complete path detection - Absolute, relative, Windows, Unix formats
  • Powerful post-processing - Deduplicate and sort (alphabetically or by length)
  • Dependency analysis - Identify missing files and circular dependencies
  • 9 file formats - JavaScript, TypeScript, JSON, HTML, CSS, TOML, CSV, ENV, Log
  • Smart filtering - Excludes npm packages (like 'react' or 'lodash')
  • Cross-platform - Handles both Windows and Unix paths
  • Canonical resolution πŸ†• - Monorepo and symlink support (disabled by default for security)
  • 13 languages - English, Chinese, German, Spanish, French, Indonesian, Italian, Japanese, Korean, Portuguese, Russian, Ukrainian, Vietnamese

πŸš€ More from the LE Family

πŸ’‘ Use Cases

  • Import Analysis - Extract local imports from JS/TS (auto-excludes npm packages)
  • Asset Auditing - Find all images, scripts, and styles referenced in HTML/CSS
  • Config Validation - Pull file paths from JSON/TOML configs for verification
  • Dependency Mapping - Track file references across your codebase

TOML & Environment Files

Extract file paths from configuration files:

# Extract from config.toml
[paths]
data_dir = "./data"
log_file = "/var/log/app.log"
backup_path = "C:\\backups\\app"
# Extract from .env
DATABASE_PATH=./data/app.db
LOG_FILE=/var/log/app.log
BACKUP_DIR=C:\backups

CSV Data Analysis

Extract paths from CSV data files:

path,type,description
./src/main.js,file,Main application file
/var/log/app.log,file,Application log
C:\Users\Name\data,dir,User data directory

Dependency Mapping & Validation

  • Map file dependencies across JavaScript/TypeScript projects
  • Identify missing or broken references in HTML/CSS
  • Validate configuration file paths
  • Analyze import patterns and detect circular dependencies

πŸš€ Quick Start

  1. Install from Open VSX or VS Code Marketplace
  2. Open any supported file (.js, .ts, .json, .html, .css, .toml, .csv, .env)
  3. Run Paths-LE: Extract Paths (Cmd+Alt+P / Ctrl+Alt+P)
  4. Use Deduplicate Paths or Sort Paths commands for post-processing

πŸ“‹ Available Commands

Paths-LE provides 9 commands accessible via Command Palette (Ctrl+Shift+P / Cmd+Shift+P):

Core Extraction

  • Extract Paths (Cmd/Ctrl+Alt+P) - Extract all file paths from current document

Post-Processing

  • Deduplicate Paths - Remove duplicate path entries while preserving order
  • Sort Paths - Sort extracted paths with multiple modes:
    • Alphabetical (A β†’ Z)
    • Alphabetical (Z β†’ A)
    • By Length (Short β†’ Long)
    • By Length (Long β†’ Short)

Settings & Help

  • Open Settings - Quick access to extension settings
  • Help & Troubleshooting - Comprehensive in-editor documentation
  • Export/Import/Reset Settings - Manage extension configuration
  • Create Test Fixture - Generate a complete test environment for canonical path resolution

βš™οΈ Configuration

Paths-LE has minimal configuration to keep things simple. Most settings are available in VS Code's settings UI under "Paths-LE".

Key settings include:

  • Output format preferences (side-by-side, clipboard copy)
  • Safety warnings and thresholds for large files
  • Notification levels (silent, important, all)
  • Status bar visibility
  • Local telemetry logging for debugging

For the complete list of available settings, open VS Code Settings and search for "paths-le".

πŸ“ Supported File Types

Paths-LE supports 9 file types for path extraction:

File Type Extensions What Gets Extracted
JavaScript .js, .mjs, .cjs import/require/export with local paths
TypeScript .ts, .tsx, .mts, .cts import/require/export with local paths
JSON .json Path-like strings (absolute, relative, URLs)
HTML .html src, href, data, action, poster, etc.
CSS .css, .scss, .less url() and @import paths
TOML .toml All string values that look like paths
CSV .csv Path values in any column
Environment .env, .env.local Path values in environment variables
Log/Text .log, .txt Pre-extracted paths for analysis

Smart Features

  • JavaScript/TypeScript: Excludes npm package namesβ€”only extracts local file paths
  • HTML: Automatically excludes data: and javascript: URLs
  • CSS: Automatically excludes data: URLs
  • All types: Handles Windows (C:\) and Unix (/) paths, plus URLs

🌍 Language Support

13 languages: English, German, Spanish, French, Indonesian, Italian, Japanese, Korean, Portuguese (Brazil), Russian, Ukrainian, Vietnamese, Chinese (Simplified)

🧩 System Requirements

VS Code 1.70.0+ β€’ Platform Windows, macOS, Linux
Memory 200MB recommended for large files

πŸ”’ Privacy

100% local processing. No data leaves your machine. Optional logging: paths-le.telemetryEnabled

⚑ Performance

Paths-LE is built for speed and handles files from 100KB to 30MB+. See detailed benchmarks.

Format File Size Throughput Duration Memory Tested On
HTML 4K lines 2,021,212 ~0.33 < 1MB Apple Silicon
CSV 0.5MB 541305 ~41.52 < 1MB Apple Silicon
CSV 3MB 865986 ~155.73 ~27MB Apple Silicon
CSV 10MB 933250 ~481.72 ~55MB Apple Silicon
CSV 30MB 0 ~1307.2 < 1MB Apple Silicon
TOML 3K lines 105,104 ~5.29 < 1MB Apple Silicon
JSON 0.12MB 898921 ~2.78 < 1MB Apple Silicon
JSON 1.21MB 1253130 ~19.97 < 1MB Apple Silicon
JSON 6.07MB 2211718 ~56.58 < 1MB Apple Silicon
JSON 24.3MB 0 ~253.36 < 1MB Apple Silicon

Real-World Performance: Tested with actual data up to 30MB (practical limit: 1MB warning, 10MB error threshold)
Performance Monitoring: Built-in real-time tracking with configurable thresholds
Full Metrics: docs/PERFORMANCE.md β€’ Test Environment: macOS, Bun 1.2.22, Node 22.x

πŸ”§ Troubleshooting

Not detecting paths?
Ensure file is saved with supported extension (.js, .ts, .json, .html, .css, .toml, .csv, .env)

Large files slow?
Files over 10MB may take longer. Consider splitting into smaller chunks

Need help?
Check Issues or enable logging: paths-le.telemetryEnabled: true

❓ FAQ

What paths are extracted?
Absolute (/usr/local), relative (./src), Windows (C:\Users), Unix (/home) paths

JS/TS imports?
Auto-excludes npm packages (react, lodash) - only extracts local file paths

Cross-platform?
Yes! Handles both Windows and Unix path formats automatically

Max file size?
Up to 30MB. Practical limit: 10MB for optimal performance

πŸ“Š Testing

289 unit tests β€’ 93.55% function coverage, 84.32% line coverage
Powered by Vitest β€’ Run with bun run test:coverage

Test Suite Breakdown

Module Tests Coverage Focus Area
Extraction Core 9 88% Main extraction logic
Collection Logic 19 95% Path collection & deduplication
JavaScript Format 13 93% Import/require/export patterns
JSON Format 13 97% Recursive path detection
HTML Format 22 90% Attribute extraction & srcset
CSS Format 16 93% url() and @import extraction
CSV Format 8 90% CSV parsing with quotes
DOTENV Format 11 78% Environment file parsing
TOML Format 9 94% TOML config parsing
Path Validation 64 100% Security & cross-platform paths
Error Handling 62 93.55% Comprehensive error coverage
Analysis 16 100% Path statistics & grouping
Validation Utils 16 66% Input sanitization
Settings Schema 36 100% Configuration validation

Performance Benchmarks (Internal)

Real-world extraction speeds tested on macOS (Apple Silicon):

  • HTML: 1.96M paths/sec (675 lines, 0.03MB file, 667 paths extracted)
  • JSON: 2.23M paths/sec (196K lines, 6.07MB file, 125K paths extracted)
  • CSV: 1.01M paths/sec (89K lines, 10MB file, 449K paths extracted)
  • TOML: 105K paths/sec (1.1K lines, 0.02MB file, 556 paths extracted)
  • JavaScript: 914K paths/sec (268 lines, 0.01MB file, 201 paths extracted)

Running Tests Locally

bun run test              # Run all 289 tests
bun run test:coverage     # Generate detailed coverage report
bun run test:watch        # Watch mode for development

Coverage reports are generated in coverage/ directory (open coverage/index.html for detailed view).

Testing Canonical Path Resolution

For Extension Users (easiest method):

  1. Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  2. Run Paths-LE: Create Test Fixture
  3. Select a folder where you want to create the test environment
  4. Follow the prompts to open the generated test workspace

For Developers (from repository):

# 1. Setup test environment
cd test-fixtures/monorepo-test
./setup-symlinks.sh

# 2. Open test workspace
code workspace.code-workspace

Testing the Feature:

  1. Enable canonical resolution in VS Code settings:

    • Paths-le β€Ί Resolution: Resolve Symlinks βœ…
    • Paths-le β€Ί Resolution: Resolve Workspace Relative βœ…
  2. Open test file: packages/frontend/src/symlink-test.js

  3. Run extraction: Paths-LE: Extract Paths (Cmd+Alt+P)

  4. Expected results:

    • Before: ./utils-link.js (symlink path)
    • After: /full/path/to/packages/shared/src/utils.js (resolved canonical path)

The test fixture includes a complete monorepo with symlinks, cross-package imports, and comprehensive documentation for testing all canonical path resolution features.

πŸ”’ Security Considerations

Canonical Path Resolution

⚠️ IMPORTANT SECURITY NOTICE: Canonical path resolution is disabled by default for security reasons.

Why it's disabled:

  • May expose sensitive file system paths in extracted output
  • Could reveal internal directory structures
  • Might leak information about development environment setup

When to enable:

  • βœ… Trusted development environments
  • βœ… Internal monorepo workflows
  • βœ… When you control the output destination
  • ❌ Public repositories or shared workspaces
  • ❌ When output might be shared externally

Security Settings:

{
  "paths-le.resolution.resolveSymlinks": false, // Default: disabled
  "paths-le.resolution.resolveWorkspaceRelative": false // Default: disabled
}

First-time Warning: When you first enable canonical resolution, Paths-LE will show a security warning dialog with options to:

  • Continue with canonical resolution
  • Disable and continue with standard resolution
  • Learn more about security implications

Copyright Β© 2025 @OffensiveEdge. All rights reserved.

About

Zero Hassle File Path Extraction & Analysis - Extract, validate, and analyze file paths from JavaScript, TypeScript, JSON, HTML, CSS, TOML, CSV, and ENV files. Smart package filtering, comprehensive validation, pattern recognition, and detailed reporting.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages