File Insights v2.0.0
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
.vsix
file 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 extension
File 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
License
MIT License - see the LICENSE file for details.
Support
Author
Vijay Gangatharan
- GitHub: @Vijay431
- Email: vijayanand431@gmail.com
⭐ If you find this extension useful, please consider giving it a star on GitHub!