openjsxl 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +20 -6
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -30,21 +30,35 @@ for await (const row of wb.sheet(wb.sheets[0].name).rows()) {
30
30
  ```
31
31
 
32
32
  For very large sheets use `streamSheetRows` (constant memory); a worksheet also exposes
33
- `numberFormat`, `dimension`, `mergedCells`, `hyperlinks`, `comments`, and `visible`, and the
34
- reader throws a typed `XlsxError` (with a discriminating `code`) on malformed input.
33
+ `style(ref)`, `numberFormat`, `dimension`, `mergedCells`, `hyperlinks`, `comments`, `columns`,
34
+ `rowProperties`, `freeze`, and `state`/`visible`, and the reader throws a typed `XlsxError`
35
+ (with a discriminating `code`) on malformed input.
35
36
 
36
- **Writing (0.3):** describe a workbook as plain data and get back `.xlsx` bytes — cell types are
37
- inferred from the JS values:
37
+ **Writing:** describe a workbook as plain data and get back `.xlsx` bytes — cell types are
38
+ inferred from the JS values. Cells can carry styles (`{ value, style }` — the same shape
39
+ `style(ref)` returns), and sheets take column widths, row heights, frozen panes, merged ranges,
40
+ hyperlinks, and a visibility state:
38
41
 
39
42
  ```ts
40
43
  import { writeXlsx } from 'openjsxl'
41
44
 
42
45
  const bytes = await writeXlsx({
43
- sheets: [{ name: 'Report', rows: [['Item', 'Added'], ['Apples', new Date('2024-01-15')]] }],
46
+ sheets: [
47
+ {
48
+ name: 'Report',
49
+ rows: [
50
+ [{ value: 'Item', style: { font: { bold: true } } }, 'Added'],
51
+ ['Apples', new Date('2024-01-15')],
52
+ ],
53
+ freeze: { rows: 1 },
54
+ hyperlinks: [{ ref: 'A2', target: 'https://example.com/apples' }],
55
+ },
56
+ ],
44
57
  })
45
58
  ```
46
59
 
47
- `workbookToInput` turns an open `Workbook` back into writer input for read → modify → write.
60
+ `workbookToInput` turns an open `Workbook` back into writer input for read → modify → write
61
+ values, types, styles, geometry, merges, hyperlinks, and sheet visibility all round-trip.
48
62
 
49
63
  See the [project README](https://github.com/joaquimserafim/openjsxl#readme) for the full guide,
50
64
  design notes, and roadmap.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openjsxl",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Fast, zero-dependency Excel (.xlsx) reader and writer for Node, Deno, Bun, and the browser.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -30,7 +30,7 @@
30
30
  ],
31
31
  "sideEffects": false,
32
32
  "dependencies": {
33
- "@openjsxl/core": "0.3.0"
33
+ "@openjsxl/core": "0.4.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@openjsxl/fixtures": "0.0.0"