Excelize
Excel Workbook Manager
Install / Use
/learn @zurmokeeper/ExcelizeREADME
@zurmokeeper/exceljs
Read, manipulate and write spreadsheet data and styles to XLSX and JSON.
Reverse engineered from Excel spreadsheet files as a project.
Special thanks
The project code is forked from exceljs, based on the last commit on 2023-5-5, [commitid](https://github.com/exceljs/exceljs/commit/ ec92cb3b898bdf7f806ff9d7b8370c955ee8ba20), Since the latest version of exceljs is v4.3.0, sincere thanks to all the developers of the exceljs project.
@zurmokeeper/exceljs is compatible with exceljs V4.3.0 and previous versions, so feel free to switch to it.
Translations
Installation
npm install @zurmokeeper/exceljs
New Features!
Since V4.4.3, the detailed update of the new version can be accessed from here.
V4.4.3 New Features!
Change Log:
- 1: BugFix: Dropdown Excel js there is limitation of accepting 255 characters and beyond that throws error.
- 2: BugFix: cell.style.fill problems, Thank you <a href="https://github.com/styunan">styunan</a>, Merged <a href="https://github.com/exceljs/exceljs/pull/1573"> PR1573</a>.
V4.4.2 New Features!
Change Log:
- 1: Fixbug: Internal hyperlink does not work on wps office. (Break change) and support new internal hyperlink methods。
- 2:Add type definition for WorksheetModel.merges, Thank you <a href="https://github.com/ytjmt">ytjmt</a>, Merged <a href="https://github.com/exceljs/exceljs/pull/2281"> PR2281</a>.
- 3:Add type definition for WorksheetProtection.spinCount,Thank you <a href="https://github.com/damingerdai">damingerdai</a>, Merged <a href="https://github.com/exceljs/exceljs/pull/2284"> PR2284</a>.
PS: Since V4.4.2 @zurmokeeper/exceljs new cell insertion internal hyperlink support Sheet2!A1:B1 and A1:B1 and other forms, the original only supports Sheet2!A1, use the following way::
const wb = new ExcelJS.Workbook();
const ws1 = wb.addWorksheet('Sheet1');
const ws2 = wb.addWorksheet('Sheet2');
'#' is required, @zurmokeeper/exceljs is to distinguish internal hyperlink by '#', the default will be considered non-internal hyperlink, older versions also need to manually add '#' , how not to add if
// internal hyperlink
ws1.getCell('A1').value = { text: 'Sheet2', hyperlink: '#Sheet2!A1' };
// internal hyperlink
ws1.getCell('A1').value = { text: 'Sheet2', hyperlink: '#Sheet2!A1:B1' };
// internal hyperlink
ws1.getCell('A1').value = { text: 'Sheet2', hyperlink: '#A1:B1' };
V4.4.1 New Features!
Change Log:
<ul> <li> Add nested columns feature. Thank you <a href="https://github.com/jeka1985">jeka1985</a>, Merged <a href="https://github.com/exceljs/exceljs/pull/1889"> PR1889</a>.Code snippets:
// new api: worksheet.makeColumns(headers)
</li>
<li>
Add file encryption function.
Code snippets:
await workbook.xlsx.writeFile(filename, {password: '123456'});
</li>
</ul>
V4.4.0 New Features!
Change Log:
<ul> <li> Add decryption of excel files with password encryption (Support frontend and backend)Code snippets:
// read from a stream, decrypt excel files encrypted with password
// const workbook = new Excel.Workbook();
// await workbook.xlsx.readFile(filename, {password:'123456'});
</li>
</ul>
New Features!
<ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1656">Add TS declarations of Workbook properties #1656</a>. Many thanks to <a href="https://github.com/kaoths">Tanawit Kritwongwiman</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/201">Fix issue #178 #201</a>. Many thanks to <a href="https://github.com/stavenko">Vasiliy Stavenko</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1649">doc: add example for solid pattern usage #1649</a>. Many thanks to <a href="https://github.com/fpaupier">fpaupier</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1629">Add type definition for lastColumn property (fixes #1453) #1629</a>. Fixes <a href="https://github.com/exceljs/exceljs/issues/1453">Add type for property of worsheet.lastcolumn #1453</a>. Many thanks to <a href="https://github.com/masterzeus05">Daniel Gonçalves</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1599">fix #1598 lint violations #1599</a>. Fixes <a href="https://github.com/exceljs/exceljs/issues/1598">[BUG] npm run lint reports multiple violations #1598</a>. Many thanks to <a href="https://github.com/iva2k">Ilya I</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1133">Update @types/node version to latest lts #1133</a>. Fixes <a href="https://github.com/exceljs/exceljs/issues/971">ERROR in node_modules/exceljs/index.d.ts(1648,34): error TS2503: Cannot find namespace 'NodeJS'. #971</a> and <a href="https://github.com/exceljs/exceljs/issues/997">ERROR in node_modules/exceljs/index.d.ts(1661,34): error TS2503: Cannot find namespace 'NodeJS'. #997</a>. Many thanks to <a href="https://github.com/Siemienik">Siemienik Pawel</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1731">Added Node v16 to the test suite #1731</a>. Many thanks to <a href="https://github.com/alexbjorlig">Alex Bjørlig</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1708">Readme moment to dayjs #1708</a>. Many thanks to <a href="https://github.com/jerebtw">Jerebtw</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/602">Ability to set tooltip for hyperlink #602</a>. Many thanks to <a href="https://github.com/kalexey89">Aleksey Kuznetsov</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1574">Fixed conditional format corrupting sheet #1305 #1574</a>. Fixes <a href="https://github.com/exceljs/exceljs/issues/1305">[BUG] Errors when opening file in Excel after saving a file with conditional formatting #1305</a>. Many thanks to <a href="https://github.com/rolandostar">Rolando Romero</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/702">Improvements for images (correct reading/writing possitions) #702</a>. Many thanks to <a href="https://github.com/Siemienik">Siemienik Pawel</a> for this contribution. </li> </ul>Contributions
Contributions are very welcome! It helps me know what features are desired or what bugs are causing the most pain.
I have just one request; If you submit a pull request for a bugfix, please add a unit-test or integration-test (in the spec folder) that catches the problem. Even a PR that just has a failing test is fine - I can analyse what the test is doing and fix the code from that.
Note: Please try to avoid modifying the package version in a PR. Versions are updated on release and any change will most likely result in merge collisions.
To be clear, all contributions added to this library will be included in the library's MIT licence.
