Repository navigation
v0.1.2
·
116 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
This is the first public release of SheetKit, a high-performance Rust library for reading and writing Excel (.xlsx) files with first-class Node.js bindings via napi-rs.
Highlights
- 44,000+ lines of Rust/TypeScript across 3 Rust crates and 1 Node.js package
- 1,333 Rust tests and 200 Node.js tests (1,533 total)
- 8 cross-platform targets for Node.js (macOS/Windows/Linux, x64/arm64)
- Dual license: MIT OR Apache-2.0
Installation
Rust:
[dependencies]
sheetkit = "0.1.2"Node.js:
npm install @sheetkit/nodeFeatures
Core Workbook I/O
- Create new workbooks, open existing
.xlsxfiles, and save with full OOXML roundtrip fidelity - ZIP-based archive handling with Deflate compression
- Async
openAsync/saveAsyncin Node.js bindings - Preserves unmodified workbook parts through open/save cycles
Cell Operations
CellValueenum:String,Number,Boolean,Empty,Date(chrono-based with Excel serial number conversion),RichString(rich text with per-run font styling)- Shared String Table (SST) runtime management
- Get/set cell values with automatic type coercion
Sheet Management
- Create, delete, rename, copy sheets
- Active sheet control
- Sheet name validation per OOXML spec
- Sheet properties (tab color, default row/column dimensions)
Row & Column Operations
- Insert, remove, duplicate rows
- Insert, remove columns
- Row height, column width with validation
- Visibility and outline level control
- Row/column iterators (
rows(),cols()) - Row/column style assignment
- Reference shifting on insert/delete operations
Style System
- Font, fill, border, alignment, number format, cell protection
StyleBuilderfluent API for ergonomic style creation- Hash-based style deduplication
- 18 built-in number format constants + custom format registration
- Theme color resolution from
theme1.xml - Gradient fills (linear/path types with color stops)
Conditional Formatting
- 18 rule types:
cellIs,expression,colorScale,dataBar,iconSet,duplicateValues,uniqueValues,top10,bottom10,aboveAverage,containsBlanks,containsText,beginsWith,endsWith, and more - Differential formatting (DXF) style support
Merge Cells
- Merge/unmerge cell ranges with overlap detection
- Get all merge cell references per sheet
Hyperlinks
- External URL, internal cell reference, and email hyperlinks
- Per-cell set/get/delete operations
Formula Parser
- nom-based parser with full operator precedence
- Cell references, range references, function calls, nested expressions
- Complete AST representation
Formula Evaluator
- 110 built-in functions across 7 categories:
- Math (17): SUM, AVERAGE, ABS, CEILING, FLOOR, MOD, POWER, ROUND, SQRT, etc.
- Statistical (10): COUNT, COUNTA, COUNTBLANK, MAX, MIN, MEDIAN, STDEV, VAR, etc.
- Information (9): ISBLANK, ISERROR, ISNUMBER, ISTEXT, TYPE, etc.
- Text (9): CONCATENATE, LEFT, RIGHT, MID, LEN, TRIM, UPPER, LOWER, etc.
- Logical (7): IF, AND, OR, NOT, TRUE, FALSE, IFERROR
- Date/Time (17): TODAY, NOW, DATE, YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, etc.
- Lookup (11): VLOOKUP, HLOOKUP, INDEX, MATCH, CHOOSE, ROW, COLUMN, etc.
evaluate_formula()for single-cell evaluationcalculate_all()with dependency graph (Kahn's algorithm topological sort)- Circular reference detection
Charts
- 41 chart types: Column, Bar, Line, Pie, Area, Scatter, Radar, Stock, Surface, Doughnut, Bubble, Combo, and their 3D/stacked/percent variants
View3Dsupport for 3D chart rotation and perspective- Scatter and bubble series with custom data points
Images
- 11 supported formats: PNG, JPEG, GIF, BMP, ICO, TIFF, SVG, EMF, EMZ, WMF, WMZ
- Cell-anchored placement with drawing management
Sparklines
- Line, Column, Win/Loss sparkline types
- 36 built-in style presets
- x14 namespace serialization with save/open roundtrip
Data Validation
- Types: dropdown list, whole number, decimal, text length, date, time, custom formula, none
- Error styles: stop, warning, information
- OOXML-compliant sqref and formula validation
allowBlank,showInputMessage,showErrorMessagecontrols- Roundtrip preservation of
showDropDown,imeMode, and container attributes
Comments
- Add, get, remove comments per cell
- Legacy VML drawing support for Excel compatibility
- VML generation and preservation through roundtrip
Auto-Filter & Tables
- Set/remove auto-filter on cell ranges
Streaming Writer
StreamWriterfor forward-only, memory-efficient large sheet generation- Per-stream SST with automatic merge into workbook SST
- Freeze panes, column width/style/visibility/outline support
- Row options: height, visibility, outline level, style
Freeze & Split Panes
set_panes()for freezing rows and columns
Defined Names
- Set, get, list, delete named ranges
- Workbook and sheet scope support
Sheet Protection
- Protect/unprotect sheets with granular permissions
Page Layout
- Margins, orientation, paper size, scale, fit-to-page
- Header/footer, print options, page breaks
Document Properties
- Core properties (title, subject, creator, dates) with DC namespace
- App properties (application, company, manager)
- Custom properties (string, number, boolean values)
Workbook Protection
- Password-based workbook protection (lock structure/windows)
- Legacy 16-bit XOR password hash
- WorkbookPr and CalcPr extended configuration
Pivot Tables
- Create, get, delete pivot tables
- Pivot cache management (definition + records)
- Row/column/data/page field configuration
- Aggregate functions (sum, count, average, max, min, etc.)
- Full 4-part OOXML serialization with relationship wiring
File Encryption (feature-gated)
- ECMA-376 Standard Encryption (AES-128-ECB, read-only)
- ECMA-376 Agile Encryption (AES-256-CBC, read/write)
open_with_password()/save_with_password()API- Automatic encrypted file detection (CFB magic bytes vs ZIP)
- Behind
encryptionfeature flag in Rust; always enabled in Node.js
Node.js Bindings
Complete napi-rs bindings covering all features above:
- napi v3 with ESM output (no CJS compatibility layer)
- Type-safe
Either-based API (noJsUnknown) DateValuestruct for date cell values- Async I/O:
openAsync,saveAsync,openWithPassword,saveWithPassword - Full TypeScript type definitions auto-generated
Cross-Platform Targets
| Platform | Architecture |
|---|---|
| macOS (Darwin) | x64, arm64 |
| Windows (MSVC) | x64, arm64 |
| Linux (GNU) | x64, arm64 |
| Linux (musl) | x64, arm64 |
Documentation
- English and Korean documentation in
docs/en/anddocs/ko/ - Modular structure: API reference (10 files), user guide (5 files), architecture, contributing, getting started
- Rust and Node.js example projects in
examples/
CI/CD
- GitHub Actions CI: Rust (build, clippy, fmt, test) + Node.js (biome, build, vitest)
- Release pipeline: cross-compilation for 8 targets, publish to crates.io + npm
Crate Structure
| Crate | Description |
|---|---|
sheetkit-xml |
Serde-based OOXML XML schema types |
sheetkit-core |
Business logic (workbook, cell, style, formula, chart, encryption, etc.) |
sheetkit |
Public facade re-exporting from sheetkit-core |
@sheetkit/node |
Node.js native addon via napi-rs |