File Insights v2.0.0
September 27, 2025 ยท View on GitHub
A lightweight Visual Studio Code extension that displays file size in the status bar with automatic formatting for bytes, KB, MB, and GB. Focused on simplicity and performance with minimal dependencies.
๐ View Documentation | ๐ Installation Guide | โจ Features
Features
Core Functionality
- ๐ File size display in status bar with low priority positioning
- ๐ Real-time updates when switching files or saving changes
- ๐ Automatic formatting displays appropriate units (B, KB, MB, GB)
- โก Lightweight architecture using internal Node.js modules only
- ๐ฏ Minimal configuration with essential settings only
Simplified Design
- Streamlined Architecture - Focused managers for specific responsibilities
- No External Dependencies - Uses only VS Code APIs and Node.js built-ins
- Low Resource Usage - Optimized for performance and memory efficiency
- Clean Separation - Clear separation between UI, configuration, and file operations
Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "File Insights"
- Click Install
From VSIX Package
- Download the latest
.vsixfile from Releases - Open VS Code
- Run
Extensions: Install from VSIX...command - Select the downloaded file
Configuration
Simple configuration options available in VS Code settings:
{
"fileInsights.enabled": true,
"fileInsights.displayFormat": "auto"
}
Settings
fileInsights.enabled- Enable/disable the extension (default:true)fileInsights.displayFormat- Size format:auto,bytes,kb,mb,gb(default:auto)
Commands
Access via Command Palette (Ctrl+Shift+P):
File Insights: Enable- Enable the extensionFile Insights: Disable- Disable the extension
How It Works
- Activation - Extension starts when VS Code loads
- File Detection - Monitors active editor changes
- Size Calculation - Uses Node.js
fs.statSync()for file statistics - Status Bar Display - Shows formatted size with file icon
- Format Selection - Auto-selects appropriate unit or uses configured format
Status Bar Display
The file size appears in the status bar (right side, low priority) with format:
๐ 1.2 KB- Kilobyte files๐ 2.5 MB- Megabyte files๐ 1.1 GB- Gigabyte files๐ 450 B- Small files in bytes
Development
Building
npm run build # Build extension
npm run watch # Development mode
npm test # Run E2E tests
npm run package # Create VSIX package
Testing
The extension includes 6 focused E2E tests:
- Extension activation
- Extension deactivation
- No file detection (status bar hidden)
- KB-sized file format display
- MB-sized file format display
- GB-sized file format display
npm test # Run all tests
Architecture
Simplified Design (v2.0.0)
src/
โโโ extension.ts # Main activation/deactivation
โโโ managers/
โ โโโ extensionManager.ts # Core extension lifecycle management
โ โโโ statusBarManager.ts # Status bar UI handling
โโโ services/
โ โโโ configurationService.ts # Settings management
โ โโโ fileStatsService.ts # File operations
โโโ utils/
โ โโโ formatter.ts # Size formatting utilities
โ โโโ logger.ts # Logging functionality
โโโ types/
โโโ extension.ts # TypeScript interfaces
โโโ common.ts # Common type definitions
Key Principles
- Focused Responsibilities - Each component has a specific, well-defined role
- Internal Dependencies - Uses only Node.js built-ins and VS Code APIs
- Performance First - Minimal overhead and resource usage
- Clean Architecture - Readable, maintainable, and testable
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests (
npm test) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
Changelog
v2.0.0 (Latest)
- BREAKING: Simplified architecture with focused managers and services
- BREAKING: Removed external dependencies (fs-extra)
- NEW: GB file size format support
- NEW: Focused E2E test suite with 6 specific tests
- IMPROVED: Performance with minimal resource usage and streamlined services
- REMOVED: Complex configuration options and telemetry
v1.x.x
- See CHANGELOG.md for previous versions
License
MIT License - see the LICENSE file for details.
Support
- ๐ Report Issues: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
- ๐ Documentation: Project Website
Author
Vijay Gangatharan
- GitHub: @Vijay431
- Email: vijayanand431@gmail.com
โญ If you find this extension useful, please consider giving it a star on GitHub!