sheetjs-vscode-extension/README.md

127 lines
5.8 KiB
Markdown
Raw Normal View History

2025-05-14 17:15:54 +00:00
# SheetJS VSCode Extension
2025-05-14 22:02:15 +00:00
[![Visual Studio Marketplace Version](https://img.shields.io/visual-studio-marketplace/v/asadbek.sheetjs-demo)](https://marketplace.visualstudio.com/items?itemName=asadbek.sheetjs-demo)
[![Visual Studio Marketplace Rating](https://img.shields.io/visual-studio-marketplace/r/asadbek.sheetjs-demo)](https://marketplace.visualstudio.com/items?itemName=asadbek.sheetjs-demo)
[![View on Marketplace](https://img.shields.io/badge/View%20on-Marketplace-blue?style=for-the-badge&logo=visualstudiocode)](https://marketplace.visualstudio.com/items?itemName=asadbek.sheetjs-demo)
2026-01-12 23:46:50 +00:00
[![Visual Studio Marketplace Downloads](https://img.shields.io/visual-studio-marketplace/d/asadbek.sheetjs-demo)](https://marketplace.visualstudio.com/items?itemName=asadbek.sheetjs-demo)
[![View on Open VSX](https://img.shields.io/badge/View%20on-Open%20VSX-blue?style=for-the-badge&logo=eclipseide)](https://open-vsx.org/extension/asadbek/sheetjs-demo)
[![Open VSX Downloads](https://img.shields.io/open-vsx/dt/asadbek/sheetjs-demo)](https://open-vsx.org/extension/asadbek/sheetjs-demo)
2025-05-14 22:02:15 +00:00
---
<img src="https://git.sheetjs.com/asadbek064/sheetjs-vscode-extension/raw/branch/main/asset/sheetjs-vscode-extension-demo.gif" alt="SheetJS VSCode Extension Preview" width="600"/>
## SpreadSheet Viewer
Powered by [SheetJS](http://sheetjs.com/) a powerful VSCode extension that lets you view spreadsheets right in your editor. Works with **XLSX**, **XLS**, **CSV**, **ODS** and 30+ other formats.
2025-05-14 17:15:54 +00:00
## Key Features
- Caches workbooks and sheets to avoid re-parsing files
- Loads sheets on-demand when switching between them
- Automatically reloads when files are edited externally
- Handles mega large files with pagination
- Toggle viewer on/off for specific file extensions via command palette or context menu
2025-05-14 17:15:54 +00:00
## Supported File Formats
2026-01-25 16:06:43 +00:00
[Supported File Formats](https://docs.sheetjs.com/docs/miscellany/formats/)
| | | |
| :--- | :--- | :--- |
| .xlsx | .prn | .wk4 |
| .xlsm | .et | .123 |
| .xlsb | .ods | .wq1 |
| .xls | .fods | .wq2 |
| .xlw | .uos | .wb1 |
| .xlr | .dbf | .wb2 |
| .numbers | .wk1 | .wb3 |
| .csv | .wk3 | .qpw |
| .dif | .wks | .xlr |
| .slk | .wk2 | .eth |
| .sylk | | |
## Usage
### Disabling/Enabling the Viewer
You can easily disable the SheetJS viewer for specific file extensions:
<img src="https://git.sheetjs.com/asadbek064/sheetjs-vscode-extension/raw/branch/main/asset/toggle_context_menu.png" alt="SheetJS VSCode Extension Preview" width="600"/>
<img src="https://git.sheetjs.com/asadbek064/sheetjs-vscode-extension/raw/branch/main/asset/toggle_ext_via_palette.png" alt="SheetJS VSCode Extension Preview" width="600"/>
**Command Palette** (Ctrl/Cmd+Shift+P):
- `SheetJS: Disable Viewer for Current File Extension` - Switches to default text editor for that extension
- `SheetJS: Enable Viewer for Current File Extension` - Re-enables the viewer
**Context Menu**: Right-click any spreadsheet file in the Explorer to access the same commands.
**Built-in VSCode**: Right-click any file and select "Open With..." to choose between SheetJS Viewer and other editors.
2025-05-14 17:15:54 +00:00
2026-01-12 23:19:57 +00:00
### Override Constants (Available Settings)
- `sheetjs.maxRows` - Rows displayed per page (default: **1000**)
- `sheetjs.maxColumns` - Columns displayed (default: **100**)
- `sheetjs.maxCachedWorkbooks` - Workbooks kept in memory (default: **10**)
- `sheetjs.maxCachedSheets` - Sheet pages cached (default: **255**)
Changes take effect when opening a new spreadsheet file (existing open files need to be reopened)
2025-05-14 17:15:54 +00:00
## Getting Started
2026-01-25 16:06:43 +00:00
Want to integrate SheetJS in your own VSCode extension? Check out our [detailed tutorial](https://docs.sheetjs.com/docs/)
to learn how to implement these capabilities in your projects.
## Why even make this?
Fair question. I view spreadsheets constantly at work—XLSX, XLS, CSV, ODS, you name it. The existing options were inadequate:
**Microsoft Excel**: Bulky. Takes several seconds to open multi-megabyte files. Overkill for just viewing data.
**Other VSCode extensions**: Tried them all. Common problems:
- Can't open older XLS formats and refuse to read large files
- Consume 500MB+ RAM for a few-megabyte file
- Ship a full Excel-like editing experience nobody asked for
**My requirements were simple**:
1. Open any spreadsheet format instantly
2. Display the actual data representation
3. Reflect external edits immediately
4. Not destroy my RAM
Extensions shouldn't replicate Excel or some other tool. They should let you quickly iterate and validate data in context.
That's what this does.
### **Some popular extension**
![other_extensions_refuses_to_open_file](https://git.sheetjs.com/asadbek064/sheetjs-vscode-extension/raw/commit/52b3c6b66f0cc9e406ad657538610b126e017fb5/asset/other_extensions_refuses_to_open_file.png)
![other_extension_600MB_ram_usage](https://git.sheetjs.com/asadbek064/sheetjs-vscode-extension/raw/commit/52b3c6b66f0cc9e406ad657538610b126e017fb5/asset/other_extension_600MB_ram_usage.png)
2026-01-25 16:06:43 +00:00
### **Mine 😊**
![mine_easy_open_large_files](https://git.sheetjs.com/asadbek064/sheetjs-vscode-extension/raw/branch/main/asset/mine_easy_open_large_files.png)
![mine_less_ram_usage](https://git.sheetjs.com/asadbek064/sheetjs-vscode-extension/raw/commit/52b3c6b66f0cc9e406ad657538610b126e017fb5/asset/mine_less_ram_usage.png)
2025-05-14 17:15:54 +00:00
## Development
To run the extension in development mode, install dependencies with `pnpm install` and press F5 in VSCode. This opens a new Extension Development Host window where you can test the extension by opening any spreadsheet file.
Build for production with `pnpm run package`.
## Publishing
```bash
npx vsce login foo
npx vsce publish
```
2025-05-14 17:15:54 +00:00
## Learn More
For more information on using this extension and integrating SheetJS capabilities in your own projects, visit our [documentation](https://docs.sheetjs.com/docs/).
2025-05-14 16:19:47 +00:00
---
2025-05-14 23:06:42 +00:00
_Created by Asadbek Karimov | [contact@asadk.dev](mailto:contact@asadk.dev) | [asadk.dev](https://asadk.dev)_