CINXE.COM
Git
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <link rel="stylesheet" href="https://static-production.npmjs.com/styles.c617df3efc3b584cc1d7.css" /> <title data-react-helmet="true">@wmakeev/exceljs - npm</title> <meta data-react-helmet="true" http-equiv="cleartype" content="on"/><meta data-react-helmet="true" name="apple-mobile-web-app-capable" content="yes"/><meta data-react-helmet="true" name="mobile-web-app-capable" content="yes"/><meta data-react-helmet="true" name="viewport" content="width=device-width,minimum-scale=1.0,initial-scale=1,user-scalable=yes"/><meta data-react-helmet="true" property="og:image" content="https://static-production.npmjs.com/338e4905a2684ca96e08c7780fc68412.png"/><meta data-react-helmet="true" name="msapplication-TileColor" content="#cb3837"/><meta data-react-helmet="true" name="msapplication-TileImage" content="https://static-production.npmjs.com/7a7ffabbd910fc60161bc04f2cee4160.png"/><meta data-react-helmet="true" name="msapplication-config" content="https://static-production.npmjs.com/668aac888e52ae13cac9cfd71fabd31f.xml"/><meta data-react-helmet="true" name="theme-color" content="#cb3837"/><meta data-react-helmet="true" name="description" content="Excel Workbook Manager - Read and Write xlsx and csv Files.. Latest version: 4.4.5, last published: 4 months ago. Start using @wmakeev/exceljs in your project by running `npm i @wmakeev/exceljs`. There is 1 other project in the npm registry using @wmakeev/exceljs."/><meta data-react-helmet="true" property="og:description" content="Excel Workbook Manager - Read and Write xlsx and csv Files.. Latest version: 4.4.5, last published: 4 months ago. Start using @wmakeev/exceljs in your project by running `npm i @wmakeev/exceljs`. There is 1 other project in the npm registry using @wmakeev/exceljs."/><meta data-react-helmet="true" property="og:title" content="@wmakeev/exceljs"/><meta data-react-helmet="true" property="og:url" content="https://www.npmjs.com/package/@wmakeev/exceljs"/><meta data-react-helmet="true" property="og:site_name" content="npm"/><meta data-react-helmet="true" name="keywords" content="xlsx,json,csv,excel,font,border,fill,number,format,number format,alignment,office,spreadsheet,workbook,defined names,data validations,rich text,in-cell format,outlineLevel,views,frozen,split,pageSetup"/><meta data-react-helmet="true" name="twitter:card" content="summary"/><meta data-react-helmet="true" name="twitter:url" content="https://www.npmjs.com/package/@wmakeev/exceljs"/><meta data-react-helmet="true" name="twitter:title" content="npm: @wmakeev/exceljs"/><meta data-react-helmet="true" name="twitter:description" content="Excel Workbook Manager - Read and Write xlsx and csv Files.. Latest version: 4.4.5, last published: 4 months ago. Start using @wmakeev/exceljs in your project by running `npm i @wmakeev/exceljs`. There is 1 other project in the npm registry using @wmakeev/exceljs."/> <link data-react-helmet="true" href="https://static-production.npmjs.com/osd.xml" rel="search" title="npm package search" type="application/opensearchdescription+xml"/><link data-react-helmet="true" rel="apple-touch-icon" sizes="120x120" href="https://static-production.npmjs.com/58a19602036db1daee0d7863c94673a4.png"/><link data-react-helmet="true" rel="apple-touch-icon" sizes="144x144" href="https://static-production.npmjs.com/7a7ffabbd910fc60161bc04f2cee4160.png"/><link data-react-helmet="true" rel="apple-touch-icon" sizes="152x152" href="https://static-production.npmjs.com/34110fd7686e2c90a487ca98e7336e99.png"/><link data-react-helmet="true" rel="apple-touch-icon" sizes="180x180" href="https://static-production.npmjs.com/3dc95981de4241b35cd55fe126ab6b2c.png"/><link data-react-helmet="true" rel="icon" type="image/png" href="https://static-production.npmjs.com/b0f1a8318363185cc2ea6a40ac23eeb2.png" sizes="32x32"/><link data-react-helmet="true" rel="icon" type="image/png" href="https://static-production.npmjs.com/1996fcfdf7ca81ea795f67f093d7f449.png" sizes="230x230"/><link data-react-helmet="true" rel="icon" type="image/png" href="https://static-production.npmjs.com/f1786e9b7cba9753ca7b9c40e8b98f67.png" sizes="96x96"/><link data-react-helmet="true" rel="icon" type="image/png" href="https://static-production.npmjs.com/5f6e93af5bf0f5dcdd1eecdac99f51ee.png" sizes="192x192"/><link data-react-helmet="true" rel="icon" type="image/png" href="https://static-production.npmjs.com/c426a1116301d1fd178c51522484127a.png" sizes="228x228"/><link data-react-helmet="true" rel="icon" type="image/png" href="https://static-production.npmjs.com/da3ab40fb0861d15c83854c29f5f2962.png" sizes="16x16"/> </head> <body> <div id="app"><div class="_452c3ec4 d68c66a8"><div class="cf325dbd list ma0 pa0 tr z-999"><div class="c746cc21 list ma0 pa0 tr z-999"></div></div><div class="flex flex-column vh-100"><header class="_755f5b0f bg-white z-2 bb b--black-20"><div></div><div class="e7070742 pv3-ns ph1-ns bg-white"><div id="header" class="bbefbfcc">skip to:<a aria-label="skip to content" class="d6d0dbcf" href="#main">content</a><a aria-label="skip to package search" class="d6d0dbcf" href="#search">package search</a><a aria-label="skip to sign in" class="d6d0dbcf" href="#signin">sign in</a></div><div class="ef7c6e62 center mw9 border-box ph4-ns ph3 flex items-center"><span class="_0edb515f pr3 dn dib-ns link lh-title dim b--white-30">❤</span><nav class="_4a5f2a79 db w-100 w-auto-ns truncate" aria-label="Product Navigation"><ul id="main-menu" class="list pl0" role="menu" aria-label="Nav Menu"><li role="none" class="dib"><a href="/products/pro" role="menuitem" class="c6c55db4 no-underline f6-ns f7 fw5 dim pr2 pl2" id="nav-pro-link">Pro</a></li><li role="none"><a href="/products/teams" role="menuitem" class="c6c55db4 no-underline f6-ns f7 fw5 dim pr2 pl2" id="nav-teams-link">Teams</a></li><li role="none" class="dib"><a href="/products" role="menuitem" class="c6c55db4 no-underline f6-ns f7 fw5 dim pr2 pl2" id="nav-pricing-link">Pricing</a></li><li role="none" class="dib"><a href="https://docs.npmjs.com" role="menuitem" class="c6c55db4 no-underline f6-ns f7 fw5 dim pr2 pl2" id="nav-docs-link">Documentation</a></li></ul></nav></div></div><div class="_4ea0e50d bt b--black-10"><div class="c5b9953b center mw9 flex flex-wrap ph4-ns border-box"><span class="_657f443d">npm</span><div class="af43375d mt3 db mr4-ns pb3 pb0-ns flex-auto 2-ns ph3 ph0-ns"><a href="/" aria-label="Npm"><svg viewBox="0 0 780 250" aria-hidden="true"><path fill="#231F20" d="M240,250h100v-50h100V0H240V250z M340,50h50v100h-50V50z M480,0v200h100V50h50v150h50V50h50v150h50V0H480z M0,200h100V50h50v150h50V0H0V200z" stroke-width="5" stroke="#f7f7f7"></path></svg></a></div><div id="search" class="_581ebd89 relative flex-auto w-100 w-50-ns pv2-ns order-1-ns order-2"><form id="search" method="GET" action="/search" class="_13c93d41 relative flex bg-transparent ph3 ph2 pv2 ph0-ns pv0-ns bt b--black-10 bn-ns"><div class="e82b10fd relative dde91b96"><div class="_2f299eeb nowrap flex"><span class="_705cdf4f db fl pl3 pr1"><svg width="15px" height="15px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" aria-hidden="true"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g stroke="#777777" stroke-width="1.3"><g><path d="M13.4044,7.0274 C13.4044,10.5494 10.5494,13.4044 7.0274,13.4044 C3.5054,13.4044 0.6504,10.5494 0.6504,7.0274 C0.6504,3.5054 3.5054,0.6504 7.0274,0.6504 C10.5494,0.6504 13.4044,3.5054 13.4044,7.0274 Z"></path><path d="M11.4913,11.4913 L17.8683,17.8683"></path></g></g></g></svg></span><input type="search" role="combobox" name="q" hotkeys="[object Object]" placeholder="Search packages" aria-label="Search packages" aria-controls="typeahead-list-416741" aria-expanded="false" aria-activedescendant="" inputref="[object Object]" autoComplete="off" class="_390acbc5 f5 fw3 black relative" value="" element="input"/></div><div aria-live="polite" aria-atomic="true" class="_6f20b8d1"></div></div><button type="submit" class="_0da775bb bn pv2 ph4 f6 white pointer bn pv2 ph4 f6 white pointer" aria-label="Search">Search</button><input type="hidden" name="csrftoken" value="gMluPm4gTkuqL9xN7pegvrtvclOQy5UYDwjSvtv7fl0"/></form></div><div class="_6f31c82b ml3 mt2 mt0-ns pv2-ns flex-auto tr nowrap relative pointer fw6 order-1 order-2-ns"><div class="_1066d9e7 flex items-center self-center pl3"><a href="/signup" id="signup" class="_9752c8b3 pa2 lh-copy br2 f6 no-underline fw5 black dim ph3 mr3">Sign Up</a><a href="/login" id="signin" class="_352269a0 pa1 lh-copy br2 f6 no-underline fw5 black dim">Sign In</a></div></div></div></div></header><main id="main"> <div class="_36ae70e9 flex flex-row flex-wrap pb5 ph3-l mw-100 mt4-ns mt1 center-ns mh1" id="top"><div class="w-100 ph0-l ph3 ph4-m"><h2 class="cd6ce1fd flex flex-row justify-start items-center w-100 fw6 mt3 black dib ma0 tracked-tight no-underline hover-black f3-ns"><span class="_50685029 truncate">@wmakeev/exceljs</span><div data-nosnippet="true"><img src="https://static-production.npmjs.com/255a118f56f5346b97e56325a1217a16.svg" height="20px" title="This package contains built-in TypeScript declarations" alt="TypeScript icon, indicating that this package has built-in type declarations" class="aa30d277 pl3" data-nosnippet="true"/></div></h2><span class="_76473bea f6 dib ph0 pv2 mb2-ns black-80 nowrap f5 fw4 lh-copy">4.4.5<!-- --> • </span><span class="_813b53b2 _76473bea f6 dib ph0 pv2 mb2-ns black-80 nowrap f5 fw4 lh-copy">Public</span><span class="_76473bea f6 dib ph0 pv2 mb2-ns black-80 nowrap f5 fw4 lh-copy"> • Published <time dateTime="2024-07-15T07:27:12.054Z" title="7/15/2024, 7:27:12 AM">4 months ago</time></span></div><ul class="cfb2a888 flex flex-column flex-row-l w-100 ma0 pa0 mr2 mr0-l list" role="tablist" aria-owns="package-tab-readme package-tab-code package-tab-dependencies package-tab-dependents package-tab-versions"><li class="_8055e658 f5 fw5 tc pointer d9f99065 ac5f7ef8 f4 fw6 black-50" role="presentation"><a class="_38ce9a85 link db ph4 fw6" href="?activeTab=readme" aria-selected="true" role="tab" aria-controls="tabpanel-readme" id="package-tab-readme" tabindex="0"><span><svg aria-hidden="true" focusable="false" data-prefix="far" data-icon="file-alt" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path fill="currentColor" d="M288 248v28c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-28c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12zm-12 72H108c-6.6 0-12 5.4-12 12v28c0 6.6 5.4 12 12 12h168c6.6 0 12-5.4 12-12v-28c0-6.6-5.4-12-12-12zm108-188.1V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V48C0 21.5 21.5 0 48 0h204.1C264.8 0 277 5.1 286 14.1L369.9 98c9 8.9 14.1 21.2 14.1 33.9zm-128-80V128h76.1L256 51.9zM336 464V176H232c-13.3 0-24-10.7-24-24V48H48v416h288z"></path></svg> Readme</span></a></li><li class="_8055e658 f5 fw5 tc pointer _7aa1ee94" role="presentation"><a class="_38ce9a85 link db ph4 fw6" href="?activeTab=code" aria-selected="false" role="tab" aria-controls="tabpanel-explore" id="package-tab-code" tabindex="-1"><span><svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="file-archive" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path fill="currentColor" d="M377 105L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128v-6.1c0-6.3-2.5-12.4-7-16.9zM128.4 336c-17.9 0-32.4 12.1-32.4 27 0 15 14.6 27 32.5 27s32.4-12.1 32.4-27-14.6-27-32.5-27zM224 136V0h-63.6v32h-32V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V160H248c-13.2 0-24-10.8-24-24zM95.9 32h32v32h-32zm32.3 384c-33.2 0-58-30.4-51.4-62.9L96.4 256v-32h32v-32h-32v-32h32v-32h-32V96h32V64h32v32h-32v32h32v32h-32v32h32v32h-32v32h22.1c5.7 0 10.7 4.1 11.8 9.7l17.3 87.7c6.4 32.4-18.4 62.6-51.4 62.6z"></path></svg>Code <span class="a17280e0"><span class="Label-sc-1t3ykp0-0 hopnJv _22665c13">Beta</span></span></span></a></li><li class="_8055e658 f5 fw5 tc pointer c1f85151" role="presentation"><a class="_38ce9a85 link db ph4 fw6" href="?activeTab=dependencies" aria-selected="false" role="tab" aria-controls="tabpanel-dependencies" id="package-tab-dependencies" tabindex="-1"><span><svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="cube" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M239.1 6.3l-208 78c-18.7 7-31.1 25-31.1 45v225.1c0 18.2 10.3 34.8 26.5 42.9l208 104c13.5 6.8 29.4 6.8 42.9 0l208-104c16.3-8.1 26.5-24.8 26.5-42.9V129.3c0-20-12.4-37.9-31.1-44.9l-208-78C262 2.2 250 2.2 239.1 6.3zM256 68.4l192 72v1.1l-192 78-192-78v-1.1l192-72zm32 356V275.5l160-65v133.9l-160 80z"></path></svg>9 Dependencies</span></a></li><li class="_8055e658 f5 fw5 tc pointer _7cec0316" role="presentation"><a class="_38ce9a85 link db ph4 fw6" href="?activeTab=dependents" aria-selected="false" role="tab" aria-controls="tabpanel-dependents" id="package-tab-dependents" tabindex="-1"><span><svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="cubes" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M488.6 250.2L392 214V105.5c0-15-9.3-28.4-23.4-33.7l-100-37.5c-8.1-3.1-17.1-3.1-25.3 0l-100 37.5c-14.1 5.3-23.4 18.7-23.4 33.7V214l-96.6 36.2C9.3 255.5 0 268.9 0 283.9V394c0 13.6 7.7 26.1 19.9 32.2l100 50c10.1 5.1 22.1 5.1 32.2 0l103.9-52 103.9 52c10.1 5.1 22.1 5.1 32.2 0l100-50c12.2-6.1 19.9-18.6 19.9-32.2V283.9c0-15-9.3-28.4-23.4-33.7zM358 214.8l-85 31.9v-68.2l85-37v73.3zM154 104.1l102-38.2 102 38.2v.6l-102 41.4-102-41.4v-.6zm84 291.1l-85 42.5v-79.1l85-38.8v75.4zm0-112l-102 41.4-102-41.4v-.6l102-38.2 102 38.2v.6zm240 112l-85 42.5v-79.1l85-38.8v75.4zm0-112l-102 41.4-102-41.4v-.6l102-38.2 102 38.2v.6z"></path></svg>1 Dependents</span></a></li><li class="_8055e658 f5 fw5 tc pointer b4fcfd19" role="presentation"><a class="_38ce9a85 link db ph4 fw6" href="?activeTab=versions" aria-selected="false" role="tab" aria-controls="tabpanel-versions" id="package-tab-versions" tabindex="-1"><span><svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="tags" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path fill="currentColor" d="M497.941 225.941L286.059 14.059A48 48 0 0 0 252.118 0H48C21.49 0 0 21.49 0 48v204.118a48 48 0 0 0 14.059 33.941l211.882 211.882c18.744 18.745 49.136 18.746 67.882 0l204.118-204.118c18.745-18.745 18.745-49.137 0-67.882zM112 160c-26.51 0-48-21.49-48-48s21.49-48 48-48 48 21.49 48 48-21.49 48-48 48zm513.941 133.823L421.823 497.941c-18.745 18.745-49.137 18.745-67.882 0l-.36-.36L527.64 323.522c16.999-16.999 26.36-39.6 26.36-63.64s-9.362-46.641-26.36-63.64L331.397 0h48.721a48 48 0 0 1 33.941 14.059l211.882 211.882c18.745 18.745 18.745 49.137 0 67.882z"></path></svg>5 Versions</span></a></li></ul><div class="_6620a4fd mw8-l mw-100 w-100 w-two-thirds-l ph3-m pt2 pl0-ns pl2"><span><section class="e22ba268 ph2 ph0-ns ml0-ns mr3-ns black-80" id="tabpanel-readme" aria-labelledby="package-tab-readme" role="tabpanel" data-attribute=""><div class=""><article><div id="readme" class="_704c034e _6d9832ac pr4-ns pl0-ns ph1-m pr3-m pr2"><div class="markdown-heading"><h1 class="heading-element">ExcelJS</h1><a id="user-content-exceljs" class="anchor" aria-label="Permalink: ExcelJS" href="#exceljs"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <blockquote> <p>This is a fork of (ExcelJS)[<a href="https://github.com/exceljs/exceljs.git">https://github.com/exceljs/exceljs.git</a>] library with some fixes.</p> </blockquote> <p><a href="https://github.com/exceljs/exceljs/actions/workflows/tests.yml"><img src="https://github.com/exceljs/exceljs/actions/workflows/tests.yml/badge.svg?branch=master&event=push" alt="Build Status" style="max-width: 100%;"></a></p> <p>Read, manipulate and write spreadsheet data and styles to XLSX and JSON.</p> <p>Reverse engineered from Excel spreadsheet files as a project.</p> <div class="markdown-heading"><h1 class="heading-element">Translations</h1><a id="user-content-translations" class="anchor" aria-label="Permalink: Translations" href="#translations"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <ul> <li><a href="https://github.com/wmakeev/exceljs/blob/HEAD/README_zh.md">中文文档</a></li> </ul> <div class="markdown-heading"><h1 class="heading-element">Installation</h1><a id="user-content-installation" class="anchor" aria-label="Permalink: Installation" href="#installation"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="highlight highlight-source-shell"><pre>npm install exceljs</pre></div> <div class="markdown-heading"><h1 class="heading-element">New Features!</h1><a id="user-content-new-features" class="anchor" aria-label="Permalink: New Features!" href="#new-features"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <ul> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/2551">Add pivot table with limitations #2551</a>. <br> Many thanks to Protobi and <a href="https://github.com/mikez">Michael</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/1815">fix: styles rendering in case when "numFmt" is present in conditional formatting rules (resolves #1814) #1815</a>. <br> Many thanks to <a href="https://github.com/andreykrupskii">@andreykrupskii</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/1576">inlineStr cell type support #1575 #1576</a>. <br> Many thanks to <a href="https://github.com/drdmitry">@drdmitry</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/1849">Fix parsing of boolean attributes #1849</a>. <br> Many thanks to <a href="https://github.com/bno1">@bno1</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/1670">add optional custom auto-filter to table #1670</a>. <br> Many thanks to <a href="https://github.com/thambley">@thambley</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/1850">Deep copy inherited style #1850</a>. <br> Many thanks to <a href="https://github.com/ikzhr">@ikzhr</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/1846">Upgrade actions/cache and actions/setup-node #1846</a>. <br> Many thanks to <a href="https://github.com/cclauss">@cclauss</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/1831">Check object keys in isEqual #1831</a>. <br> Many thanks to <a href="https://github.com/bno1">@bno1</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/1856">Add v17 to testing workflow #1856</a>. <br> Many thanks to <a href="https://github.com/Siemienik">@Siemienik</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/1895">Upgrade jszip to its latest version to date. This version does not have any vulnerability found by Snyk so far #1895</a>. <br> Many thanks to <a href="https://github.com/ValerioSevilla">@ValerioSevilla</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/1677">Update README.md #1677</a>. <br> Many thanks to <a href="https://github.com/xjrcode">@xjrcode</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/1700">(docs): set prototype of RegExp correctly. #1700</a>. <br> Many thanks to <a href="https://github.com/joeldenning">@joeldenning</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/1733">Added timeouts to github actions #1733</a>. <br> Many thanks to <a href="https://github.com/alexbjorlig">@alexbjorlig</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/1701">fix issue 1676 #1701</a>. <br> Many thanks to <a href="https://github.com/skypesky">@skypesky</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/2242">ExcelJS/ExcelJS#2237 : Update CI Tests, Drop support for Node v8 #2242</a>. <br> Many thanks to <a href="https://github.com/Siemienik">@Siemienik</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/2223">Fix types for getWorksheet() #2223</a>. <br> Many thanks to <a href="https://github.com/hfhchan-plb">@hfhchan-plb</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/2126">add characters cannot be used for worksheet name #2126</a>. <br> Many thanks to <a href="https://github.com/tkm-kj">@tkm-kj</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/1756">Fix issue #1753 Reject promise when workbook reader is writing to temporary file stream and error occurs #1756</a>. <br> Many thanks to <a href="https://github.com/pauliusg">@pauliusg</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/2186">README.md to have correct link for Streaming XLSX #2186</a>. <br> Many thanks to <a href="https://github.com/wulfsolter">@wulfsolter</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/1982">Added a polyfill of promise.finally to support lower versions of Firefox. #1982</a>. <br> Many thanks to <a href="https://github.com/DemoJj">@DemoJj</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/1934">Fix read this.worksheet before assign it #1934</a>. <br> Many thanks to <a href="https://github.com/ZyqGitHub1">@ZyqGitHub1</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/2211">chore: upgrade jszip to ^3.10.1 #2211</a>. <br> Many thanks to <a href="https://github.com/jarrod-cocoon">@jarrod-cocoon</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/2208">fixed spelling error in README.md file #2208</a>. <br> Many thanks to <a href="https://github.com/HugoP27">@HugoP27</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/2244">fix: Fix xlsx.writeFile() not catching error when error occurs #2244</a>. <br> Many thanks to <a href="https://github.com/zurmokeeper">@zurmokeeper</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/2257">Improve worksheets' naming validation logic. #2257</a>. <br> Many thanks to <a href="https://github.com/Siemienik">@Siemienik</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/2140">fix issue 2125 - spliceRows remove last row #2140</a>. <br> Many thanks to <a href="https://github.com/babu-ch">@babu-ch</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/2222">fix: fix the loss of column attributes due to incorrect column order #2222</a>. <br> Many thanks to <a href="https://github.com/cpaiyueyue">@cpaiyueyue</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/2327">Fix: Sheet Properties Types #2327</a>. <br> Many thanks to <a href="https://github.com/albeniraouf">@albeniraouf</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/2354">Use node 18 LTS for tsc, and benchmark. Add node 20. to test matrix. … #2354</a>. <br> Many thanks to <a href="https://github.com/Siemienik">@Siemienik</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/2350">Add missing tooltip attribute to CellHyperlinkValue index.d.ts #2350</a>. <br> Many thanks to <a href="https://github.com/NiklasPor">@NiklasPor</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/2320">Increase resilience to generating large workbooks #2320</a>. <br> Many thanks to <a href="https://github.com/hfhchan-plb">@hfhchan-plb</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/2324">repair all 'c2fo.io' links ('c2fo.github.io') #2324</a>. <br> Many thanks to <a href="https://github.com/justintunev7">@justintunev7</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/2309">fix: fix type definitions about last column, formula values and protection #2309</a>. <br> Many thanks to <a href="https://github.com/gltjk">@gltjk</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/2284">fix: add spinCount field for WorksheetProtection type #2284</a>. <br> Many thanks to <a href="https://github.com/damingerdai">@damingerdai</a> for this contribution!</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/2281">Add type definition for WorksheetModel.merges #2281</a>. <br> Many thanks to <a href="https://github.com/ytjmt">@ytjmt</a> for this contribution!</li> </ul> <div class="markdown-heading"><h1 class="heading-element">Contributions</h1><a id="user-content-contributions" class="anchor" aria-label="Permalink: Contributions" href="#contributions"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Contributions are very welcome! It helps me know what features are desired or what bugs are causing the most pain.</p> <p>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.</p> <p>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.</p> <p>To be clear, all contributions added to this library will be included in the library's MIT licence.</p> <div class="markdown-heading"><h3 class="heading-element">Let's chat together:</h3><a id="user-content-lets-chat-together" class="anchor" aria-label="Permalink: Let's chat together:" href="#lets-chat-together"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p><a href="https://discord.gg/siema" rel="nofollow"><img src="https://camo.githubusercontent.com/1ead9fc7294c1cd19ef554af3570c1f715ccf089a6952ca9eb309879b2a66177/68747470733a2f2f646973636f72646170702e636f6d2f6170692f6775696c64732f3937363835343434323030393832353332312f7769646765742e706e673f7374796c653d62616e6e657232" alt="SiemaTeam" data-canonical-src="https://discordapp.com/api/guilds/976854442009825321/widget.png?style=banner2" style="max-width: 100%;"></a></p> <div class="markdown-heading"><h1 class="heading-element">Contents</h1><a id="user-content-contents" class="anchor" aria-label="Permalink: Contents" href="#contents"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <ul> <li><a href="#importing">Importing</a></li> <li> <a href="#interface">Interface</a> <ul> <li><a href="#create-a-workbook">Create a Workbook</a></li> <li><a href="#set-workbook-properties">Set Workbook Properties</a></li> <li><a href="#workbook-views">Workbook Views</a></li> <li><a href="#add-a-worksheet">Add a Worksheet</a></li> <li><a href="#remove-a-worksheet">Remove a Worksheet</a></li> <li><a href="#access-worksheets">Access Worksheets</a></li> <li><a href="#worksheet-state">Worksheet State</a></li> <li><a href="#worksheet-properties">Worksheet Properties</a></li> <li><a href="#page-setup">Page Setup</a></li> <li><a href="#headers-and-footers">Headers and Footers</a></li> <li> <a href="#worksheet-views">Worksheet Views</a> <ul> <li><a href="#frozen-views">Frozen Views</a></li> <li><a href="#split-views">Split Views</a></li> </ul> </li> <li><a href="#auto-filters">Auto Filters</a></li> <li><a href="#columns">Columns</a></li> <li> <a href="#rows">Rows</a> <ul> <li><a href="#add-rows">Add Rows</a></li> <li><a href="#handling-individual-cells">Handling Individual Cells</a></li> <li><a href="#merged-cells">Merged Cells</a></li> <li><a href="#insert-rows">Insert Rows</a></li> <li><a href="#splice">Splice</a></li> <li><a href="#duplicate-a-row">Duplicate Row</a></li> </ul> </li> <li><a href="#defined-names">Defined Names</a></li> <li><a href="#data-validations">Data Validations</a></li> <li><a href="#cell-comments">Cell Comments</a></li> <li><a href="#tables">Tables</a></li> <li> <a href="#styles">Styles</a> <ul> <li><a href="#number-formats">Number Formats</a></li> <li><a href="#fonts">Fonts</a></li> <li><a href="#alignment">Alignment</a></li> <li><a href="#borders">Borders</a></li> <li><a href="#fills">Fills</a></li> <li><a href="#rich-text">Rich Text</a></li> </ul> </li> <li><a href="#conditional-formatting">Conditional Formatting</a></li> <li><a href="#outline-levels">Outline Levels</a></li> <li><a href="#images">Images</a></li> <li><a href="#sheet-protection">Sheet Protection</a></li> <li> <a href="#file-io">File I/O</a> <ul> <li> <a href="#xlsx">XLSX</a> <ul> <li><a href="#reading-xlsx">Reading XLSX</a></li> <li><a href="#writing-xlsx">Writing XLSX</a></li> </ul> </li> <li> <a href="#csv">CSV</a> <ul> <li><a href="#reading-csv">Reading CSV</a></li> <li><a href="#writing-csv">Writing CSV</a></li> </ul> </li> <li> <a href="#streaming-io">Streaming I/O</a> <ul> <li><a href="#streaming-xlsx">Streaming XLSX</a></li> </ul> </li> </ul> </li> </ul> </li> <li><a href="#browser">Browser</a></li> <li> <a href="#value-types">Value Types</a> <ul> <li><a href="#null-value">Null Value</a></li> <li><a href="#merge-cell">Merge Cell</a></li> <li><a href="#number-value">Number Value</a></li> <li><a href="#string-value">String Value</a></li> <li><a href="#date-value">Date Value</a></li> <li><a href="#hyperlink-value">Hyperlink Value</a></li> <li> <a href="#formula-value">Formula Value</a> <ul> <li><a href="#shared-formula">Shared Formula</a></li> <li><a href="#formula-type">Formula Type</a></li> <li><a href="#array-formula">Array Formula</a></li> </ul> </li> <li><a href="#rich-text-value">Rich Text Value</a></li> <li><a href="#boolean-value">Boolean Value</a></li> <li><a href="#error-value">Error Value</a></li> </ul> </li> <li><a href="#config">Config</a></li> <li><a href="#known-issues">Known Issues</a></li> <li><a href="#release-history">Release History</a></li> </ul> <div class="markdown-heading"><h1 class="heading-element">Importing<a href="#contents">⬆</a> </h1><a id="user-content-importing" class="anchor" aria-label="Permalink: Importing⬆" href="#importing"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-v">ExcelJS</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'exceljs'</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">ES5 Imports<a href="#contents">⬆</a> </h2><a id="user-content-es5-imports" class="anchor" aria-label="Permalink: ES5 Imports⬆" href="#es5-imports"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>To use the ES5 transpiled code, for example for node.js versions older than 10, use the dist/es5 path.</p> <div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-v">ExcelJS</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'exceljs/dist/es5'</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p><strong>Note:</strong> The ES5 build has an implicit dependency on a number of polyfills which are no longer explicitly added by exceljs. You will need to add "core-js" and "regenerator-runtime" to your dependencies and include the following requires in your code before the exceljs import:</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// polyfills required by exceljs</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'core-js/modules/es.promise'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'core-js/modules/es.string.includes'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'core-js/modules/es.object.assign'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'core-js/modules/es.object.keys'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'core-js/modules/es.symbol'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'core-js/modules/es.symbol.async-iterator'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'regenerator-runtime/runtime'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-v">ExcelJS</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'exceljs/dist/es5'</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p>For IE 11, you'll also need a polyfill to support unicode regex patterns. For example,</p> <div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-s1">rewritePattern</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'regexpu-core'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-kos">{</span>generateRegexpuOptions<span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'@babel/helper-create-regexp-features-plugin/lib/util'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-kos">{</span>RegExp<span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-s1">global</span><span class="pl-kos">;</span> <span class="pl-k">try</span> <span class="pl-kos">{</span> <span class="pl-k">new</span> <span class="pl-v">RegExp</span><span class="pl-kos">(</span><span class="pl-s">'a'</span><span class="pl-kos">,</span> <span class="pl-s">'u'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">catch</span> <span class="pl-kos">(</span><span class="pl-s1">err</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-s1">global</span><span class="pl-kos">.</span><span class="pl-en">RegExp</span> <span class="pl-c1">=</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">pattern</span><span class="pl-kos">,</span> <span class="pl-s1">flags</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">flags</span> <span class="pl-c1">&&</span> <span class="pl-s1">flags</span><span class="pl-kos">.</span><span class="pl-en">includes</span><span class="pl-kos">(</span><span class="pl-s">'u'</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-v">RegExp</span><span class="pl-kos">(</span><span class="pl-s1">rewritePattern</span><span class="pl-kos">(</span><span class="pl-s1">pattern</span><span class="pl-kos">,</span> <span class="pl-s1">flags</span><span class="pl-kos">,</span> <span class="pl-en">generateRegexpuOptions</span><span class="pl-kos">(</span><span class="pl-kos">{</span>flags<span class="pl-kos">,</span> pattern<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-v">RegExp</span><span class="pl-kos">(</span><span class="pl-s1">pattern</span><span class="pl-kos">,</span> <span class="pl-s1">flags</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-s1">global</span><span class="pl-kos">.</span><span class="pl-c1">RegExp</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span> <span class="pl-c1">=</span> <span class="pl-v">RegExp</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">;</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Browserify<a href="#contents">⬆</a> </h2><a id="user-content-browserify" class="anchor" aria-label="Permalink: Browserify⬆" href="#browserify"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>ExcelJS publishes two browserified bundles inside the dist/ folder:</p> <p>One with implicit dependencies on core-js polyfills...</p> <div class="highlight highlight-text-html-basic"><pre><span class="pl-kos"><</span><span class="pl-ent">script</span> <span class="pl-c1">src</span>="<span class="pl-s">https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.26.0/polyfill.js</span>"<span class="pl-kos">></span><span class="pl-kos"></</span><span class="pl-ent">script</span><span class="pl-kos">></span> <span class="pl-kos"><</span><span class="pl-ent">script</span> <span class="pl-c1">src</span>="<span class="pl-s">exceljs.js</span>"<span class="pl-kos">></span><span class="pl-kos"></</span><span class="pl-ent">script</span><span class="pl-kos">></span></pre></div> <p>And one without...</p> <div class="highlight highlight-text-html-basic"><pre><span class="pl-kos"><</span><span class="pl-ent">script</span> <span class="pl-c1">src</span>="<span class="pl-s">--your-project's-pollyfills-here--</span>"<span class="pl-kos">></span><span class="pl-kos"></</span><span class="pl-ent">script</span><span class="pl-kos">></span> <span class="pl-kos"><</span><span class="pl-ent">script</span> <span class="pl-c1">src</span>="<span class="pl-s">exceljs.bare.js</span>"<span class="pl-kos">></span><span class="pl-kos"></</span><span class="pl-ent">script</span><span class="pl-kos">></span></pre></div> <div class="markdown-heading"><h1 class="heading-element">Interface<a href="#contents">⬆</a> </h1><a id="user-content-interface" class="anchor" aria-label="Permalink: Interface⬆" href="#interface"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="markdown-heading"><h2 class="heading-element">Create a Workbook<a href="#contents">⬆</a> </h2><a id="user-content-create-a-workbook" class="anchor" aria-label="Permalink: Create a Workbook⬆" href="#create-a-workbook"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-s1">workbook</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">ExcelJS</span><span class="pl-kos">.</span><span class="pl-c1">Workbook</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Set Workbook Properties<a href="#contents">⬆</a> </h2><a id="user-content-set-workbook-properties" class="anchor" aria-label="Permalink: Set Workbook Properties⬆" href="#set-workbook-properties"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="highlight highlight-source-js"><pre><span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">creator</span> <span class="pl-c1">=</span> <span class="pl-s">'Me'</span><span class="pl-kos">;</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">lastModifiedBy</span> <span class="pl-c1">=</span> <span class="pl-s">'Her'</span><span class="pl-kos">;</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">created</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-c1">1985</span><span class="pl-kos">,</span> <span class="pl-c1">8</span><span class="pl-kos">,</span> <span class="pl-c1">30</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">modified</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">lastPrinted</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-c1">2016</span><span class="pl-kos">,</span> <span class="pl-c1">9</span><span class="pl-kos">,</span> <span class="pl-c1">27</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <div class="highlight highlight-source-js"><pre><span class="pl-c">// Set workbook dates to 1904 date system</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">properties</span><span class="pl-kos">.</span><span class="pl-c1">date1904</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Set Calculation Properties<a href="#contents">⬆</a> </h2><a id="user-content-set-calculation-properties" class="anchor" aria-label="Permalink: Set Calculation Properties⬆" href="#set-calculation-properties"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="highlight highlight-source-js"><pre><span class="pl-c">// Force workbook calculation on load</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">calcProperties</span><span class="pl-kos">.</span><span class="pl-c1">fullCalcOnLoad</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Workbook Views<a href="#contents">⬆</a> </h2><a id="user-content-workbook-views" class="anchor" aria-label="Permalink: Workbook Views⬆" href="#workbook-views"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>The Workbook views controls how many separate windows Excel will open when viewing the workbook.</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">views</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-c1">y</span>: <span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-c1">width</span>: <span class="pl-c1">10000</span><span class="pl-kos">,</span> <span class="pl-c1">height</span>: <span class="pl-c1">20000</span><span class="pl-kos">,</span> <span class="pl-c1">firstSheet</span>: <span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-c1">activeTab</span>: <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">visibility</span>: <span class="pl-s">'visible'</span> <span class="pl-kos">}</span> <span class="pl-kos">]</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Add a Worksheet<a href="#contents">⬆</a> </h2><a id="user-content-add-a-worksheet" class="anchor" aria-label="Permalink: Add a Worksheet⬆" href="#add-a-worksheet"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-s1">sheet</span> <span class="pl-c1">=</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-en">addWorksheet</span><span class="pl-kos">(</span><span class="pl-s">'My Sheet'</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p>Use the second parameter of the addWorksheet function to specify options for the worksheet.</p> <p>For Example:</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// create a sheet with red tab colour</span> <span class="pl-k">const</span> <span class="pl-s1">sheet</span> <span class="pl-c1">=</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-en">addWorksheet</span><span class="pl-kos">(</span><span class="pl-s">'My Sheet'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-c1">properties</span>:<span class="pl-kos">{</span><span class="pl-c1">tabColor</span>:<span class="pl-kos">{</span><span class="pl-c1">argb</span>:<span class="pl-s">'FFC0000'</span><span class="pl-kos">}</span><span class="pl-kos">}</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// create a sheet where the grid lines are hidden</span> <span class="pl-k">const</span> <span class="pl-s1">sheet</span> <span class="pl-c1">=</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-en">addWorksheet</span><span class="pl-kos">(</span><span class="pl-s">'My Sheet'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-c1">views</span>: <span class="pl-kos">[</span><span class="pl-kos">{</span><span class="pl-c1">showGridLines</span>: <span class="pl-c1">false</span><span class="pl-kos">}</span><span class="pl-kos">]</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// create a sheet with the first row and column frozen</span> <span class="pl-k">const</span> <span class="pl-s1">sheet</span> <span class="pl-c1">=</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-en">addWorksheet</span><span class="pl-kos">(</span><span class="pl-s">'My Sheet'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-c1">views</span>:<span class="pl-kos">[</span><span class="pl-kos">{</span><span class="pl-c1">state</span>: <span class="pl-s">'frozen'</span><span class="pl-kos">,</span> <span class="pl-c1">xSplit</span>: <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">ySplit</span>:<span class="pl-c1">1</span><span class="pl-kos">}</span><span class="pl-kos">]</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Create worksheets with headers and footers</span> <span class="pl-k">const</span> <span class="pl-s1">sheet</span> <span class="pl-c1">=</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-en">addWorksheet</span><span class="pl-kos">(</span><span class="pl-s">'My Sheet'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">headerFooter</span>:<span class="pl-kos">{</span><span class="pl-c1">firstHeader</span>: <span class="pl-s">"Hello Exceljs"</span><span class="pl-kos">,</span> <span class="pl-c1">firstFooter</span>: <span class="pl-s">"Hello World"</span><span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// create new sheet with pageSetup settings for A4 - landscape</span> <span class="pl-k">const</span> <span class="pl-s1">worksheet</span> <span class="pl-c1">=</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-en">addWorksheet</span><span class="pl-kos">(</span><span class="pl-s">'My Sheet'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">pageSetup</span>:<span class="pl-kos">{</span><span class="pl-c1">paperSize</span>: <span class="pl-c1">9</span><span class="pl-kos">,</span> <span class="pl-c1">orientation</span>:<span class="pl-s">'landscape'</span><span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Remove a Worksheet<a href="#contents">⬆</a> </h2><a id="user-content-remove-a-worksheet" class="anchor" aria-label="Permalink: Remove a Worksheet⬆" href="#remove-a-worksheet"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Use the worksheet <code>id</code> to remove the sheet from workbook.</p> <p>For Example:</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// Create a worksheet</span> <span class="pl-k">const</span> <span class="pl-s1">sheet</span> <span class="pl-c1">=</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-en">addWorksheet</span><span class="pl-kos">(</span><span class="pl-s">'My Sheet'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Remove the worksheet using worksheet id</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-en">removeWorksheet</span><span class="pl-kos">(</span><span class="pl-s1">sheet</span><span class="pl-kos">.</span><span class="pl-c1">id</span><span class="pl-kos">)</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Access Worksheets<a href="#contents">⬆</a> </h2><a id="user-content-access-worksheets" class="anchor" aria-label="Permalink: Access Worksheets⬆" href="#access-worksheets"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="highlight highlight-source-js"><pre><span class="pl-c">// Iterate over all sheets</span> <span class="pl-c">// Note: workbook.worksheets.forEach will still work but this is better</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-en">eachSheet</span><span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">worksheet</span><span class="pl-kos">,</span> <span class="pl-s1">sheetId</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-c">// ...</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// fetch sheet by name</span> <span class="pl-k">const</span> <span class="pl-s1">worksheet</span> <span class="pl-c1">=</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-en">getWorksheet</span><span class="pl-kos">(</span><span class="pl-s">'My Sheet'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// fetch sheet by id</span> <span class="pl-c">// INFO: Be careful when using it!</span> <span class="pl-c">// It tries to access to `worksheet.id` field. Sometimes (really very often) workbook has worksheets with id not starting from 1.</span> <span class="pl-c">// For instance It happens when any worksheet has been deleted.</span> <span class="pl-c">// It's much more safety when you assume that ids are random. And stop to use this function.</span> <span class="pl-c">// If you need to access all worksheets in a loop please look to the next example.</span> <span class="pl-k">const</span> <span class="pl-s1">worksheet</span> <span class="pl-c1">=</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-en">getWorksheet</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// access by `worksheets` array:</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">worksheets</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-c">//the first one;</span></pre></div> <p>It's important to know that <code>workbook.getWorksheet(1) != Workbook.worksheets[0]</code> and <code>workbook.getWorksheet(1) != Workbook.worksheets[1]</code>, because <code>workbook.worksheets[0].id</code> may have any value.</p> <div class="markdown-heading"><h2 class="heading-element">Worksheet State<a href="#contents">⬆</a> </h2><a id="user-content-worksheet-state" class="anchor" aria-label="Permalink: Worksheet State⬆" href="#worksheet-state"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="highlight highlight-source-js"><pre><span class="pl-c">// make worksheet visible</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">state</span> <span class="pl-c1">=</span> <span class="pl-s">'visible'</span><span class="pl-kos">;</span> <span class="pl-c">// make worksheet hidden</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">state</span> <span class="pl-c1">=</span> <span class="pl-s">'hidden'</span><span class="pl-kos">;</span> <span class="pl-c">// make worksheet hidden from 'hide/unhide' dialog</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">state</span> <span class="pl-c1">=</span> <span class="pl-s">'veryHidden'</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Worksheet Properties<a href="#contents">⬆</a> </h2><a id="user-content-worksheet-properties" class="anchor" aria-label="Permalink: Worksheet Properties⬆" href="#worksheet-properties"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Worksheets support a property bucket to allow control over some features of the worksheet.</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// create new sheet with properties</span> <span class="pl-k">const</span> <span class="pl-s1">worksheet</span> <span class="pl-c1">=</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-en">addWorksheet</span><span class="pl-kos">(</span><span class="pl-s">'sheet'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-c1">properties</span>:<span class="pl-kos">{</span><span class="pl-c1">tabColor</span>:<span class="pl-kos">{</span><span class="pl-c1">argb</span>:<span class="pl-s">'FF00FF00'</span><span class="pl-kos">}</span><span class="pl-kos">}</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// create a new sheet writer with properties</span> <span class="pl-k">const</span> <span class="pl-s1">worksheetWriter</span> <span class="pl-c1">=</span> <span class="pl-s1">workbookWriter</span><span class="pl-kos">.</span><span class="pl-en">addWorksheet</span><span class="pl-kos">(</span><span class="pl-s">'sheet'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-c1">properties</span>:<span class="pl-kos">{</span><span class="pl-c1">outlineLevelCol</span>:<span class="pl-c1">1</span><span class="pl-kos">}</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// adjust properties afterwards (not supported by worksheet-writer)</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">properties</span><span class="pl-kos">.</span><span class="pl-c1">outlineLevelCol</span> <span class="pl-c1">=</span> <span class="pl-c1">2</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">properties</span><span class="pl-kos">.</span><span class="pl-c1">defaultRowHeight</span> <span class="pl-c1">=</span> <span class="pl-c1">15</span><span class="pl-kos">;</span></pre></div> <p><strong>Supported Properties</strong></p> <table> <thead> <tr> <th>Name</th> <th>Default</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>tabColor</td> <td>undefined</td> <td>Color of the tabs</td> </tr> <tr> <td>outlineLevelCol</td> <td>0</td> <td>The worksheet column outline level</td> </tr> <tr> <td>outlineLevelRow</td> <td>0</td> <td>The worksheet row outline level</td> </tr> <tr> <td>defaultRowHeight</td> <td>15</td> <td>Default row height</td> </tr> <tr> <td>defaultColWidth</td> <td>(optional)</td> <td>Default column width</td> </tr> <tr> <td>dyDescent</td> <td>55</td> <td>TBD</td> </tr> </tbody> </table> <div class="markdown-heading"><h3 class="heading-element">Worksheet Metrics<a href="#contents">⬆</a> </h3><a id="user-content-worksheet-metrics" class="anchor" aria-label="Permalink: Worksheet Metrics⬆" href="#worksheet-metrics"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Some new metrics have been added to Worksheet...</p> <table> <thead> <tr> <th>Name</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>rowCount</td> <td>The total row size of the document. Equal to the row number of the last row that has values.</td> </tr> <tr> <td>actualRowCount</td> <td>A count of the number of rows that have values. If a mid-document row is empty, it will not be included in the count.</td> </tr> <tr> <td>columnCount</td> <td>The total column size of the document. Equal to the maximum cell count from all of the rows</td> </tr> <tr> <td>actualColumnCount</td> <td>A count of the number of columns that have values.</td> </tr> </tbody> </table> <div class="markdown-heading"><h2 class="heading-element">Page Setup<a href="#contents">⬆</a> </h2><a id="user-content-page-setup" class="anchor" aria-label="Permalink: Page Setup⬆" href="#page-setup"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>All properties that can affect the printing of a sheet are held in a pageSetup object on the sheet.</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// create new sheet with pageSetup settings for A4 - landscape</span> <span class="pl-k">const</span> <span class="pl-s1">worksheet</span> <span class="pl-c1">=</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-en">addWorksheet</span><span class="pl-kos">(</span><span class="pl-s">'sheet'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">pageSetup</span>:<span class="pl-kos">{</span><span class="pl-c1">paperSize</span>: <span class="pl-c1">9</span><span class="pl-kos">,</span> <span class="pl-c1">orientation</span>:<span class="pl-s">'landscape'</span><span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// create a new sheet writer with pageSetup settings for fit-to-page</span> <span class="pl-k">const</span> <span class="pl-s1">worksheetWriter</span> <span class="pl-c1">=</span> <span class="pl-s1">workbookWriter</span><span class="pl-kos">.</span><span class="pl-en">addWorksheet</span><span class="pl-kos">(</span><span class="pl-s">'sheet'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">pageSetup</span>:<span class="pl-kos">{</span><span class="pl-c1">fitToPage</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">fitToHeight</span>: <span class="pl-c1">5</span><span class="pl-kos">,</span> <span class="pl-c1">fitToWidth</span>: <span class="pl-c1">7</span><span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// adjust pageSetup settings afterwards</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">pageSetup</span><span class="pl-kos">.</span><span class="pl-c1">margins</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">left</span>: <span class="pl-c1">0.7</span><span class="pl-kos">,</span> <span class="pl-c1">right</span>: <span class="pl-c1">0.7</span><span class="pl-kos">,</span> <span class="pl-c1">top</span>: <span class="pl-c1">0.75</span><span class="pl-kos">,</span> <span class="pl-c1">bottom</span>: <span class="pl-c1">0.75</span><span class="pl-kos">,</span> <span class="pl-c1">header</span>: <span class="pl-c1">0.3</span><span class="pl-kos">,</span> <span class="pl-c1">footer</span>: <span class="pl-c1">0.3</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// Set Print Area for a sheet</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">pageSetup</span><span class="pl-kos">.</span><span class="pl-c1">printArea</span> <span class="pl-c1">=</span> <span class="pl-s">'A1:G20'</span><span class="pl-kos">;</span> <span class="pl-c">// Set multiple Print Areas by separating print areas with '&&'</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">pageSetup</span><span class="pl-kos">.</span><span class="pl-c1">printArea</span> <span class="pl-c1">=</span> <span class="pl-s">'A1:G10&&A11:G20'</span><span class="pl-kos">;</span> <span class="pl-c">// Repeat specific rows on every printed page</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">pageSetup</span><span class="pl-kos">.</span><span class="pl-c1">printTitlesRow</span> <span class="pl-c1">=</span> <span class="pl-s">'1:3'</span><span class="pl-kos">;</span> <span class="pl-c">// Repeat specific columns on every printed page</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">pageSetup</span><span class="pl-kos">.</span><span class="pl-c1">printTitlesColumn</span> <span class="pl-c1">=</span> <span class="pl-s">'A:C'</span><span class="pl-kos">;</span></pre></div> <p><strong>Supported pageSetup settings</strong></p> <table> <thead> <tr> <th>Name</th> <th>Default</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>margins</td> <td></td> <td>Whitespace on the borders of the page. Units are inches.</td> </tr> <tr> <td>orientation</td> <td>'portrait'</td> <td>Orientation of the page - i.e. taller (portrait) or wider (landscape)</td> </tr> <tr> <td>horizontalDpi</td> <td>4294967295</td> <td>Horizontal Dots per Inch. Default value is -1</td> </tr> <tr> <td>verticalDpi</td> <td>4294967295</td> <td>Vertical Dots per Inch. Default value is -1</td> </tr> <tr> <td>fitToPage</td> <td></td> <td>Whether to use fitToWidth and fitToHeight or scale settings. Default is based on presence of these settings in the pageSetup object - if both are present, scale wins (i.e. default will be false)</td> </tr> <tr> <td>pageOrder</td> <td>'downThenOver'</td> <td>Which order to print the pages - one of ['downThenOver', 'overThenDown']</td> </tr> <tr> <td>blackAndWhite</td> <td>false</td> <td>Print without colour</td> </tr> <tr> <td>draft</td> <td>false</td> <td>Print with less quality (and ink)</td> </tr> <tr> <td>cellComments</td> <td>'None'</td> <td>Where to place comments - one of ['atEnd', 'asDisplayed', 'None']</td> </tr> <tr> <td>errors</td> <td>'displayed'</td> <td>Where to show errors - one of ['dash', 'blank', 'NA', 'displayed']</td> </tr> <tr> <td>scale</td> <td>100</td> <td>Percentage value to increase or reduce the size of the print. Active when fitToPage is false</td> </tr> <tr> <td>fitToWidth</td> <td>1</td> <td>How many pages wide the sheet should print on to. Active when fitToPage is true</td> </tr> <tr> <td>fitToHeight</td> <td>1</td> <td>How many pages high the sheet should print on to. Active when fitToPage is true</td> </tr> <tr> <td>paperSize</td> <td></td> <td>What paper size to use (see below)</td> </tr> <tr> <td>showRowColHeaders</td> <td>false</td> <td>Whether to show the row numbers and column letters</td> </tr> <tr> <td>showGridLines</td> <td>false</td> <td>Whether to show grid lines</td> </tr> <tr> <td>firstPageNumber</td> <td></td> <td>Which number to use for the first page</td> </tr> <tr> <td>horizontalCentered</td> <td>false</td> <td>Whether to center the sheet data horizontally</td> </tr> <tr> <td>verticalCentered</td> <td>false</td> <td>Whether to center the sheet data vertically</td> </tr> </tbody> </table> <p><strong>Example Paper Sizes</strong></p> <table> <thead> <tr> <th>Name</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>Letter</td> <td>undefined</td> </tr> <tr> <td>Legal</td> <td>5</td> </tr> <tr> <td>Executive</td> <td>7</td> </tr> <tr> <td>A3</td> <td>8</td> </tr> <tr> <td>A4</td> <td>9</td> </tr> <tr> <td>A5</td> <td>11</td> </tr> <tr> <td>B5 (JIS)</td> <td>13</td> </tr> <tr> <td>Envelope #10</td> <td>20</td> </tr> <tr> <td>Envelope DL</td> <td>27</td> </tr> <tr> <td>Envelope C5</td> <td>28</td> </tr> <tr> <td>Envelope B5</td> <td>34</td> </tr> <tr> <td>Envelope Monarch</td> <td>37</td> </tr> <tr> <td>Double Japan Postcard Rotated</td> <td>82</td> </tr> <tr> <td>16K 197x273 mm</td> <td>119</td> </tr> </tbody> </table> <div class="markdown-heading"><h2 class="heading-element">Headers and Footers<a href="#contents">⬆</a> </h2><a id="user-content-headers-and-footers" class="anchor" aria-label="Permalink: Headers and Footers⬆" href="#headers-and-footers"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Here's how to add headers and footers. The added content is mainly text, such as time, introduction, file information, etc., and you can set the style of the text. In addition, you can set different texts for the first page and even page.</p> <p>Note: Images are not currently supported.</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// Create worksheets with headers and footers</span> <span class="pl-k">var</span> <span class="pl-s1">sheet</span> <span class="pl-c1">=</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-en">addWorksheet</span><span class="pl-kos">(</span><span class="pl-s">'sheet'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">headerFooter</span>:<span class="pl-kos">{</span><span class="pl-c1">firstHeader</span>: <span class="pl-s">"Hello Exceljs"</span><span class="pl-kos">,</span> <span class="pl-c1">firstFooter</span>: <span class="pl-s">"Hello World"</span><span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Create worksheets with headers and footers</span> <span class="pl-k">var</span> <span class="pl-s1">worksheetWriter</span> <span class="pl-c1">=</span> <span class="pl-s1">workbookWriter</span><span class="pl-kos">.</span><span class="pl-en">addWorksheet</span><span class="pl-kos">(</span><span class="pl-s">'sheet'</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">headerFooter</span>:<span class="pl-kos">{</span><span class="pl-c1">firstHeader</span>: <span class="pl-s">"Hello Exceljs"</span><span class="pl-kos">,</span> <span class="pl-c1">firstFooter</span>: <span class="pl-s">"Hello World"</span><span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Set footer (default centered), result: "Page 2 of 16"</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">headerFooter</span><span class="pl-kos">.</span><span class="pl-c1">oddFooter</span> <span class="pl-c1">=</span> <span class="pl-s">"Page &P of &N"</span><span class="pl-kos">;</span> <span class="pl-c">// Set the footer (default centered) to bold, resulting in: "Page 2 of 16"</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">headerFooter</span><span class="pl-kos">.</span><span class="pl-c1">oddFooter</span> <span class="pl-c1">=</span> <span class="pl-s">"Page &P of &N"</span><span class="pl-kos">;</span> <span class="pl-c">// Set the left footer to 18px and italicize. Result: "Page 2 of 16"</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">headerFooter</span><span class="pl-kos">.</span><span class="pl-c1">oddFooter</span> <span class="pl-c1">=</span> <span class="pl-s">"&LPage &P of &N"</span><span class="pl-kos">;</span> <span class="pl-c">// Set the middle header to gray Aril, the result: "52 exceljs"</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">headerFooter</span><span class="pl-kos">.</span><span class="pl-c1">oddHeader</span> <span class="pl-c1">=</span> <span class="pl-s">"&C&KCCCCCC&\"Aril\"52 exceljs"</span><span class="pl-kos">;</span> <span class="pl-c">// Set the left, center, and right text of the footer. Result: “Exceljs” in the footer left. “demo.xlsx” in the footer center. “Page 2” in the footer right</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">headerFooter</span><span class="pl-kos">.</span><span class="pl-c1">oddFooter</span> <span class="pl-c1">=</span> <span class="pl-s">"&Lexceljs&C&F&RPage &P"</span><span class="pl-kos">;</span> <span class="pl-c">// Add different header & footer for the first page</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">headerFooter</span><span class="pl-kos">.</span><span class="pl-c1">differentFirst</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">headerFooter</span><span class="pl-kos">.</span><span class="pl-c1">firstHeader</span> <span class="pl-c1">=</span> <span class="pl-s">"Hello Exceljs"</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">headerFooter</span><span class="pl-kos">.</span><span class="pl-c1">firstFooter</span> <span class="pl-c1">=</span> <span class="pl-s">"Hello World"</span></pre></div> <p><strong>Supported headerFooter settings</strong></p> <table> <thead> <tr> <th>Name</th> <th>Default</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>differentFirst</td> <td>false</td> <td>Set the value of differentFirst as true, which indicates that headers/footers for first page are different from the other pages</td> </tr> <tr> <td>differentOddEven</td> <td>false</td> <td>Set the value of differentOddEven as true, which indicates that headers/footers for odd and even pages are different</td> </tr> <tr> <td>oddHeader</td> <td>null</td> <td>Set header string for odd(default) pages, could format the string</td> </tr> <tr> <td>oddFooter</td> <td>null</td> <td>Set footer string for odd(default) pages, could format the string</td> </tr> <tr> <td>evenHeader</td> <td>null</td> <td>Set header string for even pages, could format the string</td> </tr> <tr> <td>evenFooter</td> <td>null</td> <td>Set footer string for even pages, could format the string</td> </tr> <tr> <td>firstHeader</td> <td>null</td> <td>Set header string for the first page, could format the string</td> </tr> <tr> <td>firstFooter</td> <td>null</td> <td>Set footer string for the first page, could format the string</td> </tr> </tbody> </table> <p><strong>Script Commands</strong></p> <table> <thead> <tr> <th>Commands</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>&L</td> <td>Set position to the left</td> </tr> <tr> <td>&C</td> <td>Set position to the center</td> </tr> <tr> <td>&R</td> <td>Set position to the right</td> </tr> <tr> <td>&P</td> <td>The current page number</td> </tr> <tr> <td>&N</td> <td>The total number of pages</td> </tr> <tr> <td>&D</td> <td>The current date</td> </tr> <tr> <td>&T</td> <td>The current time</td> </tr> <tr> <td>&G</td> <td>A picture</td> </tr> <tr> <td>&A</td> <td>The worksheet name</td> </tr> <tr> <td>&F</td> <td>The file name</td> </tr> <tr> <td>&B</td> <td>Make text bold</td> </tr> <tr> <td>&I</td> <td>Italicize text</td> </tr> <tr> <td>&U</td> <td>Underline text</td> </tr> <tr> <td>&"font name"</td> <td>font name, for example &"Aril"</td> </tr> <tr> <td>&font size</td> <td>font size, for example 12</td> </tr> <tr> <td>&KHEXCode</td> <td>font color, for example &KCCCCCC</td> </tr> </tbody> </table> <div class="markdown-heading"><h2 class="heading-element">Worksheet Views<a href="#contents">⬆</a> </h2><a id="user-content-worksheet-views" class="anchor" aria-label="Permalink: Worksheet Views⬆" href="#worksheet-views"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Worksheets now support a list of views, that control how Excel presents the sheet:</p> <ul> <li>frozen - where a number of rows and columns to the top and left are frozen in place. Only the bottom right section will scroll</li> <li>split - where the view is split into 4 sections, each semi-independently scrollable.</li> </ul> <p>Each view also supports various properties:</p> <table> <thead> <tr> <th>Name</th> <th>Default</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>state</td> <td>'normal'</td> <td>Controls the view state - one of normal, frozen or split</td> </tr> <tr> <td>rightToLeft</td> <td>false</td> <td>Sets the worksheet view's orientation to right-to-left</td> </tr> <tr> <td>activeCell</td> <td>undefined</td> <td>The currently selected cell</td> </tr> <tr> <td>showRuler</td> <td>true</td> <td>Shows or hides the ruler in Page Layout</td> </tr> <tr> <td>showRowColHeaders</td> <td>true</td> <td>Shows or hides the row and column headers (e.g. A1, B1 at the top and 1,2,3 on the left</td> </tr> <tr> <td>showGridLines</td> <td>true</td> <td>Shows or hides the gridlines (shown for cells where borders have not been defined)</td> </tr> <tr> <td>zoomScale</td> <td>100</td> <td>Percentage zoom to use for the view</td> </tr> <tr> <td>zoomScaleNormal</td> <td>100</td> <td>Normal zoom for the view</td> </tr> <tr> <td>style</td> <td>undefined</td> <td>Presentation style - one of pageBreakPreview or pageLayout. Note pageLayout is not compatible with frozen views</td> </tr> </tbody> </table> <div class="markdown-heading"><h3 class="heading-element">Frozen Views<a href="#contents">⬆</a> </h3><a id="user-content-frozen-views" class="anchor" aria-label="Permalink: Frozen Views⬆" href="#frozen-views"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Frozen views support the following extra properties:</p> <table> <thead> <tr> <th>Name</th> <th>Default</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>xSplit</td> <td>0</td> <td>How many columns to freeze. To freeze rows only, set this to 0 or undefined</td> </tr> <tr> <td>ySplit</td> <td>0</td> <td>How many rows to freeze. To freeze columns only, set this to 0 or undefined</td> </tr> <tr> <td>topLeftCell</td> <td>special</td> <td>Which cell will be top-left in the bottom-right pane. Note: cannot be a frozen cell. Defaults to first unfrozen cell</td> </tr> </tbody> </table> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">views</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span> <span class="pl-kos">{</span><span class="pl-c1">state</span>: <span class="pl-s">'frozen'</span><span class="pl-kos">,</span> <span class="pl-c1">xSplit</span>: <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-c1">ySplit</span>: <span class="pl-c1">3</span><span class="pl-kos">,</span> <span class="pl-c1">topLeftCell</span>: <span class="pl-s">'G10'</span><span class="pl-kos">,</span> <span class="pl-c1">activeCell</span>: <span class="pl-s">'A1'</span><span class="pl-kos">}</span> <span class="pl-kos">]</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Split Views<a href="#contents">⬆</a> </h3><a id="user-content-split-views" class="anchor" aria-label="Permalink: Split Views⬆" href="#split-views"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Split views support the following extra properties:</p> <table> <thead> <tr> <th>Name</th> <th>Default</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>xSplit</td> <td>0</td> <td>How many points from the left to place the splitter. To split vertically, set this to 0 or undefined</td> </tr> <tr> <td>ySplit</td> <td>0</td> <td>How many points from the top to place the splitter. To split horizontally, set this to 0 or undefined</td> </tr> <tr> <td>topLeftCell</td> <td>undefined</td> <td>Which cell will be top-left in the bottom-right pane.</td> </tr> <tr> <td>activePane</td> <td>undefined</td> <td>Which pane will be active - one of topLeft, topRight, bottomLeft and bottomRight</td> </tr> </tbody> </table> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">views</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span> <span class="pl-kos">{</span><span class="pl-c1">state</span>: <span class="pl-s">'split'</span><span class="pl-kos">,</span> <span class="pl-c1">xSplit</span>: <span class="pl-c1">2000</span><span class="pl-kos">,</span> <span class="pl-c1">ySplit</span>: <span class="pl-c1">3000</span><span class="pl-kos">,</span> <span class="pl-c1">topLeftCell</span>: <span class="pl-s">'G10'</span><span class="pl-kos">,</span> <span class="pl-c1">activeCell</span>: <span class="pl-s">'A1'</span><span class="pl-kos">}</span> <span class="pl-kos">]</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Auto filters<a href="#contents">⬆</a> </h2><a id="user-content-auto-filters" class="anchor" aria-label="Permalink: Auto filters⬆" href="#auto-filters"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>It is possible to apply an auto filter to your worksheet.</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">autoFilter</span> <span class="pl-c1">=</span> <span class="pl-s">'A1:C1'</span><span class="pl-kos">;</span></pre></div> <p>While the range string is the standard form of the autoFilter, the worksheet will also support the following values:</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// Set an auto filter from A1 to C1</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">autoFilter</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">from</span>: <span class="pl-s">'A1'</span><span class="pl-kos">,</span> <span class="pl-c1">to</span>: <span class="pl-s">'C1'</span><span class="pl-kos">,</span> <span class="pl-kos">}</span> <span class="pl-c">// Set an auto filter from the cell in row 3 and column 1</span> <span class="pl-c">// to the cell in row 5 and column 12</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">autoFilter</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">from</span>: <span class="pl-kos">{</span> <span class="pl-c1">row</span>: <span class="pl-c1">3</span><span class="pl-kos">,</span> <span class="pl-c1">column</span>: <span class="pl-c1">1</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">to</span>: <span class="pl-kos">{</span> <span class="pl-c1">row</span>: <span class="pl-c1">5</span><span class="pl-kos">,</span> <span class="pl-c1">column</span>: <span class="pl-c1">12</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-c">// Set an auto filter from D3 to the</span> <span class="pl-c">// cell in row 7 and column 5</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">autoFilter</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">from</span>: <span class="pl-s">'D3'</span><span class="pl-kos">,</span> <span class="pl-c1">to</span>: <span class="pl-kos">{</span> <span class="pl-c1">row</span>: <span class="pl-c1">7</span><span class="pl-kos">,</span> <span class="pl-c1">column</span>: <span class="pl-c1">5</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Columns<a href="#contents">⬆</a> </h2><a id="user-content-columns" class="anchor" aria-label="Permalink: Columns⬆" href="#columns"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="highlight highlight-source-js"><pre><span class="pl-c">// Add column headers and define column keys and widths</span> <span class="pl-c">// Note: these column structures are a workbook-building convenience only,</span> <span class="pl-c">// apart from the column width, they will not be fully persisted.</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">columns</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span> <span class="pl-kos">{</span> <span class="pl-c1">header</span>: <span class="pl-s">'Id'</span><span class="pl-kos">,</span> <span class="pl-c1">key</span>: <span class="pl-s">'id'</span><span class="pl-kos">,</span> <span class="pl-c1">width</span>: <span class="pl-c1">10</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">header</span>: <span class="pl-s">'Name'</span><span class="pl-kos">,</span> <span class="pl-c1">key</span>: <span class="pl-s">'name'</span><span class="pl-kos">,</span> <span class="pl-c1">width</span>: <span class="pl-c1">32</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">header</span>: <span class="pl-s">'D.O.B.'</span><span class="pl-kos">,</span> <span class="pl-c1">key</span>: <span class="pl-s">'DOB'</span><span class="pl-kos">,</span> <span class="pl-c1">width</span>: <span class="pl-c1">10</span><span class="pl-kos">,</span> <span class="pl-c1">outlineLevel</span>: <span class="pl-c1">1</span> <span class="pl-kos">}</span> <span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-c">// Access an individual columns by key, letter and 1-based column number</span> <span class="pl-k">const</span> <span class="pl-s1">idCol</span> <span class="pl-c1">=</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getColumn</span><span class="pl-kos">(</span><span class="pl-s">'id'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">nameCol</span> <span class="pl-c1">=</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getColumn</span><span class="pl-kos">(</span><span class="pl-s">'B'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">dobCol</span> <span class="pl-c1">=</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getColumn</span><span class="pl-kos">(</span><span class="pl-c1">3</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// set column properties</span> <span class="pl-c">// Note: will overwrite cell value C1</span> <span class="pl-s1">dobCol</span><span class="pl-kos">.</span><span class="pl-c1">header</span> <span class="pl-c1">=</span> <span class="pl-s">'Date of Birth'</span><span class="pl-kos">;</span> <span class="pl-c">// Note: this will overwrite cell values C1:C2</span> <span class="pl-s1">dobCol</span><span class="pl-kos">.</span><span class="pl-c1">header</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-s">'Date of Birth'</span><span class="pl-kos">,</span> <span class="pl-s">'A.K.A. D.O.B.'</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-c">// from this point on, this column will be indexed by 'dob' and not 'DOB'</span> <span class="pl-s1">dobCol</span><span class="pl-kos">.</span><span class="pl-c1">key</span> <span class="pl-c1">=</span> <span class="pl-s">'dob'</span><span class="pl-kos">;</span> <span class="pl-s1">dobCol</span><span class="pl-kos">.</span><span class="pl-c1">width</span> <span class="pl-c1">=</span> <span class="pl-c1">15</span><span class="pl-kos">;</span> <span class="pl-c">// Hide the column if you'd like</span> <span class="pl-s1">dobCol</span><span class="pl-kos">.</span><span class="pl-c1">hidden</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span> <span class="pl-c">// set an outline level for columns</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getColumn</span><span class="pl-kos">(</span><span class="pl-c1">4</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">outlineLevel</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getColumn</span><span class="pl-kos">(</span><span class="pl-c1">5</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">outlineLevel</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-c">// columns support a readonly field to indicate the collapsed state based on outlineLevel</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getColumn</span><span class="pl-kos">(</span><span class="pl-c1">4</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">collapsed</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">to</span><span class="pl-kos">.</span><span class="pl-en">equal</span><span class="pl-kos">(</span><span class="pl-c1">false</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getColumn</span><span class="pl-kos">(</span><span class="pl-c1">5</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">collapsed</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">to</span><span class="pl-kos">.</span><span class="pl-en">equal</span><span class="pl-kos">(</span><span class="pl-c1">true</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// iterate over all current cells in this column</span> <span class="pl-s1">dobCol</span><span class="pl-kos">.</span><span class="pl-en">eachCell</span><span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">cell</span><span class="pl-kos">,</span> <span class="pl-s1">rowNumber</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-c">// ...</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// iterate over all current cells in this column including empty cells</span> <span class="pl-s1">dobCol</span><span class="pl-kos">.</span><span class="pl-en">eachCell</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">includeEmpty</span>: <span class="pl-c1">true</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">cell</span><span class="pl-kos">,</span> <span class="pl-s1">rowNumber</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-c">// ...</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// add a column of new values</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getColumn</span><span class="pl-kos">(</span><span class="pl-c1">6</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">values</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">,</span><span class="pl-c1">2</span><span class="pl-kos">,</span><span class="pl-c1">3</span><span class="pl-kos">,</span><span class="pl-c1">4</span><span class="pl-kos">,</span><span class="pl-c1">5</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-c">// add a sparse column of values</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getColumn</span><span class="pl-kos">(</span><span class="pl-c1">7</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">values</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">,</span><span class="pl-kos">,</span><span class="pl-c1">2</span><span class="pl-kos">,</span><span class="pl-c1">3</span><span class="pl-kos">,</span><span class="pl-kos">,</span><span class="pl-c1">5</span><span class="pl-kos">,</span><span class="pl-kos">,</span><span class="pl-c1">7</span><span class="pl-kos">,</span><span class="pl-kos">,</span><span class="pl-kos">,</span><span class="pl-kos">,</span><span class="pl-c1">11</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-c">// cut one or more columns (columns to the right are shifted left)</span> <span class="pl-c">// If column properties have been defined, they will be cut or moved accordingly</span> <span class="pl-c">// Known Issue: If a splice causes any merged cells to move, the results may be unpredictable</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">spliceColumns</span><span class="pl-kos">(</span><span class="pl-c1">3</span><span class="pl-kos">,</span><span class="pl-c1">2</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// remove one column and insert two more.</span> <span class="pl-c">// Note: columns 4 and above will be shifted right by 1 column.</span> <span class="pl-c">// Also: If the worksheet has more rows than values in the column inserts,</span> <span class="pl-c">// the rows will still be shifted as if the values existed</span> <span class="pl-k">const</span> <span class="pl-s1">newCol3Values</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">,</span><span class="pl-c1">2</span><span class="pl-kos">,</span><span class="pl-c1">3</span><span class="pl-kos">,</span><span class="pl-c1">4</span><span class="pl-kos">,</span><span class="pl-c1">5</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">newCol4Values</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-s">'one'</span><span class="pl-kos">,</span> <span class="pl-s">'two'</span><span class="pl-kos">,</span> <span class="pl-s">'three'</span><span class="pl-kos">,</span> <span class="pl-s">'four'</span><span class="pl-kos">,</span> <span class="pl-s">'five'</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">spliceColumns</span><span class="pl-kos">(</span><span class="pl-c1">3</span><span class="pl-kos">,</span> <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-s1">newCol3Values</span><span class="pl-kos">,</span> <span class="pl-s1">newCol4Values</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Rows<a href="#contents">⬆</a> </h2><a id="user-content-rows" class="anchor" aria-label="Permalink: Rows⬆" href="#rows"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="highlight highlight-source-js"><pre><span class="pl-c">// Get a row object. If it doesn't already exist, a new empty one will be returned</span> <span class="pl-k">const</span> <span class="pl-s1">row</span> <span class="pl-c1">=</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getRow</span><span class="pl-kos">(</span><span class="pl-c1">5</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Get multiple row objects. If it doesn't already exist, new empty ones will be returned</span> <span class="pl-k">const</span> <span class="pl-s1">rows</span> <span class="pl-c1">=</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getRows</span><span class="pl-kos">(</span><span class="pl-c1">5</span><span class="pl-kos">,</span> <span class="pl-c1">2</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// start, length (>0, else undefined is returned)</span> <span class="pl-c">// Get the last editable row in a worksheet (or undefined if there are none)</span> <span class="pl-k">const</span> <span class="pl-s1">row</span> <span class="pl-c1">=</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">lastRow</span><span class="pl-kos">;</span> <span class="pl-c">// Set a specific row height</span> <span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-c1">height</span> <span class="pl-c1">=</span> <span class="pl-c1">42.5</span><span class="pl-kos">;</span> <span class="pl-c">// make row hidden</span> <span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-c1">hidden</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span> <span class="pl-c">// set an outline level for rows</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getRow</span><span class="pl-kos">(</span><span class="pl-c1">4</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">outlineLevel</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getRow</span><span class="pl-kos">(</span><span class="pl-c1">5</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">outlineLevel</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-c">// rows support a readonly field to indicate the collapsed state based on outlineLevel</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getRow</span><span class="pl-kos">(</span><span class="pl-c1">4</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">collapsed</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">to</span><span class="pl-kos">.</span><span class="pl-en">equal</span><span class="pl-kos">(</span><span class="pl-c1">false</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getRow</span><span class="pl-kos">(</span><span class="pl-c1">5</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">collapsed</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">to</span><span class="pl-kos">.</span><span class="pl-en">equal</span><span class="pl-kos">(</span><span class="pl-c1">true</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-c1">5</span><span class="pl-kos">;</span> <span class="pl-c">// A5's value set to 5</span> <span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'name'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-s">'Zeb'</span><span class="pl-kos">;</span> <span class="pl-c">// B5's value set to 'Zeb' - assuming column 2 is still keyed by name</span> <span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'C'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// C5's value set to now</span> <span class="pl-c">// Get a row as a sparse array</span> <span class="pl-c">// Note: interface change: worksheet.getRow(4) ==> worksheet.getRow(4).values</span> <span class="pl-s1">row</span> <span class="pl-c1">=</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getRow</span><span class="pl-kos">(</span><span class="pl-c1">4</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">values</span><span class="pl-kos">;</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">row</span><span class="pl-kos">[</span><span class="pl-c1">5</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toEqual</span><span class="pl-kos">(</span><span class="pl-s">'Kyle'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// assign row values by contiguous array (where array element 0 has a value)</span> <span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-c1">values</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">,</span><span class="pl-c1">2</span><span class="pl-kos">,</span><span class="pl-c1">3</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toEqual</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-c1">2</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toEqual</span><span class="pl-kos">(</span><span class="pl-c1">2</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-c1">3</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toEqual</span><span class="pl-kos">(</span><span class="pl-c1">3</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// assign row values by sparse array (where array element 0 is undefined)</span> <span class="pl-k">const</span> <span class="pl-s1">values</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">]</span> <span class="pl-s1">values</span><span class="pl-kos">[</span><span class="pl-c1">5</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-c1">7</span><span class="pl-kos">;</span> <span class="pl-s1">values</span><span class="pl-kos">[</span><span class="pl-c1">10</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-s">'Hello, World!'</span><span class="pl-kos">;</span> <span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-c1">values</span> <span class="pl-c1">=</span> <span class="pl-s1">values</span><span class="pl-kos">;</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toBeNull</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-c1">5</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toEqual</span><span class="pl-kos">(</span><span class="pl-c1">7</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-c1">10</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toEqual</span><span class="pl-kos">(</span><span class="pl-s">'Hello, World!'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// assign row values by object, using column keys</span> <span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-c1">values</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">id</span>: <span class="pl-c1">13</span><span class="pl-kos">,</span> <span class="pl-c1">name</span>: <span class="pl-s">'Thing 1'</span><span class="pl-kos">,</span> <span class="pl-c1">dob</span>: <span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// Insert a page break below the row</span> <span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-en">addPageBreak</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Iterate over all rows that have values in a worksheet</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">eachRow</span><span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">row</span><span class="pl-kos">,</span> <span class="pl-s1">rowNumber</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'Row '</span> <span class="pl-c1">+</span> <span class="pl-s1">rowNumber</span> <span class="pl-c1">+</span> <span class="pl-s">' = '</span> <span class="pl-c1">+</span> <span class="pl-c1">JSON</span><span class="pl-kos">.</span><span class="pl-en">stringify</span><span class="pl-kos">(</span><span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-c1">values</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Iterate over all rows (including empty rows) in a worksheet</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">eachRow</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">includeEmpty</span>: <span class="pl-c1">true</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">row</span><span class="pl-kos">,</span> <span class="pl-s1">rowNumber</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'Row '</span> <span class="pl-c1">+</span> <span class="pl-s1">rowNumber</span> <span class="pl-c1">+</span> <span class="pl-s">' = '</span> <span class="pl-c1">+</span> <span class="pl-c1">JSON</span><span class="pl-kos">.</span><span class="pl-en">stringify</span><span class="pl-kos">(</span><span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-c1">values</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Iterate over all non-null cells in a row</span> <span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-en">eachCell</span><span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">cell</span><span class="pl-kos">,</span> <span class="pl-s1">colNumber</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'Cell '</span> <span class="pl-c1">+</span> <span class="pl-s1">colNumber</span> <span class="pl-c1">+</span> <span class="pl-s">' = '</span> <span class="pl-c1">+</span> <span class="pl-s1">cell</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Iterate over all cells in a row (including empty cells)</span> <span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-en">eachCell</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">includeEmpty</span>: <span class="pl-c1">true</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">cell</span><span class="pl-kos">,</span> <span class="pl-s1">colNumber</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'Cell '</span> <span class="pl-c1">+</span> <span class="pl-s1">colNumber</span> <span class="pl-c1">+</span> <span class="pl-s">' = '</span> <span class="pl-c1">+</span> <span class="pl-s1">cell</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Commit a completed row to stream</span> <span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-en">commit</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// row metrics</span> <span class="pl-k">const</span> <span class="pl-s1">rowSize</span> <span class="pl-c1">=</span> <span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-c1">cellCount</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">numValues</span> <span class="pl-c1">=</span> <span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-c1">actualCellCount</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Add Rows<a href="#contents">⬆</a> </h2><a id="user-content-add-rows" class="anchor" aria-label="Permalink: Add Rows⬆" href="#add-rows"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="highlight highlight-source-js"><pre><span class="pl-c">// Add a couple of Rows by key-value, after the last current row, using the column keys</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">addRow</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">id</span>: <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">name</span>: <span class="pl-s">'John Doe'</span><span class="pl-kos">,</span> <span class="pl-c1">dob</span>: <span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-c1">1970</span><span class="pl-kos">,</span><span class="pl-c1">1</span><span class="pl-kos">,</span><span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">addRow</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">id</span>: <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-c1">name</span>: <span class="pl-s">'Jane Doe'</span><span class="pl-kos">,</span> <span class="pl-c1">dob</span>: <span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-c1">1965</span><span class="pl-kos">,</span><span class="pl-c1">1</span><span class="pl-kos">,</span><span class="pl-c1">7</span><span class="pl-kos">)</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Add a row by contiguous Array (assign to columns A, B & C)</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">addRow</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-c1">3</span><span class="pl-kos">,</span> <span class="pl-s">'Sam'</span><span class="pl-kos">,</span> <span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Add a row by sparse Array (assign to columns A, E & I)</span> <span class="pl-k">const</span> <span class="pl-s1">rowValues</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-s1">rowValues</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-c1">4</span><span class="pl-kos">;</span> <span class="pl-s1">rowValues</span><span class="pl-kos">[</span><span class="pl-c1">5</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-s">'Kyle'</span><span class="pl-kos">;</span> <span class="pl-s1">rowValues</span><span class="pl-kos">[</span><span class="pl-c1">9</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">addRow</span><span class="pl-kos">(</span><span class="pl-s1">rowValues</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Add a row with inherited style</span> <span class="pl-c">// This new row will have same style as last row</span> <span class="pl-c">// And return as row object</span> <span class="pl-k">const</span> <span class="pl-s1">newRow</span> <span class="pl-c1">=</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">addRow</span><span class="pl-kos">(</span><span class="pl-s1">rowValues</span><span class="pl-kos">,</span> <span class="pl-s">'i'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Add an array of rows</span> <span class="pl-k">const</span> <span class="pl-s1">rows</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span> <span class="pl-kos">[</span><span class="pl-c1">5</span><span class="pl-kos">,</span><span class="pl-s">'Bob'</span><span class="pl-kos">,</span><span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c">// row by array</span> <span class="pl-kos">{</span><span class="pl-c1">id</span>:<span class="pl-c1">6</span><span class="pl-kos">,</span> <span class="pl-c1">name</span>: <span class="pl-s">'Barbara'</span><span class="pl-kos">,</span> <span class="pl-c1">dob</span>: <span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">}</span> <span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-c">// add new rows and return them as array of row objects</span> <span class="pl-k">const</span> <span class="pl-s1">newRows</span> <span class="pl-c1">=</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">addRows</span><span class="pl-kos">(</span><span class="pl-s1">rows</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Add an array of rows with inherited style</span> <span class="pl-c">// These new rows will have same styles as last row</span> <span class="pl-c">// and return them as array of row objects</span> <span class="pl-k">const</span> <span class="pl-s1">newRowsStyled</span> <span class="pl-c1">=</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">addRows</span><span class="pl-kos">(</span><span class="pl-s1">rows</span><span class="pl-kos">,</span> <span class="pl-s">'i'</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <table> <thead> <tr> <th>Parameter</th> <th>Description</th> <th>Default Value</th> </tr> </thead> <tbody> <tr> <td>value/s</td> <td>The new row/s values</td> <td></td> </tr> <tr> <td>style</td> <td>'i' for inherit from row above, 'i+' to include empty cells, 'n' for none</td> <td><em>'n'</em></td> </tr> </tbody> </table> <div class="markdown-heading"><h2 class="heading-element">Handling Individual Cells<a href="#contents">⬆</a> </h2><a id="user-content-handling-individual-cells" class="anchor" aria-label="Permalink: Handling Individual Cells⬆" href="#handling-individual-cells"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-s1">cell</span> <span class="pl-c1">=</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'C3'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Modify/Add individual cell</span> <span class="pl-s1">cell</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-c1">1968</span><span class="pl-kos">,</span> <span class="pl-c1">5</span><span class="pl-kos">,</span> <span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// query a cell's type</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">cell</span><span class="pl-kos">.</span><span class="pl-c1">type</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toEqual</span><span class="pl-kos">(</span><span class="pl-v">Excel</span><span class="pl-kos">.</span><span class="pl-c1">ValueType</span><span class="pl-kos">.</span><span class="pl-c1">Date</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// use string value of cell</span> <span class="pl-s1">myInput</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-s1">cell</span><span class="pl-kos">.</span><span class="pl-c1">text</span><span class="pl-kos">;</span> <span class="pl-c">// use html-safe string for rendering...</span> <span class="pl-k">const</span> <span class="pl-s1">html</span> <span class="pl-c1">=</span> <span class="pl-s">'<div>'</span> <span class="pl-c1">+</span> <span class="pl-s1">cell</span><span class="pl-kos">.</span><span class="pl-c1">html</span> <span class="pl-c1">+</span> <span class="pl-s">'</div>'</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Merged Cells<a href="#contents">⬆</a> </h2><a id="user-content-merged-cells" class="anchor" aria-label="Permalink: Merged Cells⬆" href="#merged-cells"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="highlight highlight-source-js"><pre><span class="pl-c">// merge a range of cells</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">mergeCells</span><span class="pl-kos">(</span><span class="pl-s">'A4:B5'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// ... merged cells are linked</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'B5'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-s">'Hello, World!'</span><span class="pl-kos">;</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'B5'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toBe</span><span class="pl-kos">(</span><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A4'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'B5'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">master</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toBe</span><span class="pl-kos">(</span><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A4'</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// ... merged cells share the same style object</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'B5'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">style</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toBe</span><span class="pl-kos">(</span><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A4'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">style</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'B5'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">style</span><span class="pl-kos">.</span><span class="pl-c1">font</span> <span class="pl-c1">=</span> <span class="pl-s1">myFonts</span><span class="pl-kos">.</span><span class="pl-c1">arial</span><span class="pl-kos">;</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A4'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">style</span><span class="pl-kos">.</span><span class="pl-c1">font</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toBe</span><span class="pl-kos">(</span><span class="pl-s1">myFonts</span><span class="pl-kos">.</span><span class="pl-c1">arial</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// unmerging the cells breaks the style links</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">unMergeCells</span><span class="pl-kos">(</span><span class="pl-s">'A4'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'B5'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">style</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">not</span><span class="pl-kos">.</span><span class="pl-en">toBe</span><span class="pl-kos">(</span><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A4'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">style</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'B5'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">style</span><span class="pl-kos">.</span><span class="pl-c1">font</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">not</span><span class="pl-kos">.</span><span class="pl-en">toBe</span><span class="pl-kos">(</span><span class="pl-s1">myFonts</span><span class="pl-kos">.</span><span class="pl-c1">arial</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// merge by top-left, bottom-right</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">mergeCells</span><span class="pl-kos">(</span><span class="pl-s">'K10'</span><span class="pl-kos">,</span> <span class="pl-s">'M12'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// merge by start row, start column, end row, end column (equivalent to K10:M12)</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">mergeCells</span><span class="pl-kos">(</span><span class="pl-c1">10</span><span class="pl-kos">,</span><span class="pl-c1">11</span><span class="pl-kos">,</span><span class="pl-c1">12</span><span class="pl-kos">,</span><span class="pl-c1">13</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Insert Rows<a href="#contents">⬆</a> </h2><a id="user-content-insert-rows" class="anchor" aria-label="Permalink: Insert Rows⬆" href="#insert-rows"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="highlight highlight-source-js"><pre><span class="pl-en">insertRow</span><span class="pl-kos">(</span><span class="pl-s1">pos</span><span class="pl-kos">,</span> <span class="pl-s1">value</span><span class="pl-kos">,</span> <span class="pl-s1">style</span> <span class="pl-c1">=</span> <span class="pl-s">'n'</span><span class="pl-kos">)</span> <span class="pl-en">insertRows</span><span class="pl-kos">(</span><span class="pl-s1">pos</span><span class="pl-kos">,</span> <span class="pl-s1">values</span><span class="pl-kos">,</span> <span class="pl-s1">style</span> <span class="pl-c1">=</span> <span class="pl-s">'n'</span><span class="pl-kos">)</span> <span class="pl-c">// Insert a couple of Rows by key-value, shifting down rows every time</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">insertRow</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-c1">id</span>: <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">name</span>: <span class="pl-s">'John Doe'</span><span class="pl-kos">,</span> <span class="pl-c1">dob</span>: <span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-c1">1970</span><span class="pl-kos">,</span><span class="pl-c1">1</span><span class="pl-kos">,</span><span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">insertRow</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-c1">id</span>: <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-c1">name</span>: <span class="pl-s">'Jane Doe'</span><span class="pl-kos">,</span> <span class="pl-c1">dob</span>: <span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-c1">1965</span><span class="pl-kos">,</span><span class="pl-c1">1</span><span class="pl-kos">,</span><span class="pl-c1">7</span><span class="pl-kos">)</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Insert a row by contiguous Array (assign to columns A, B & C)</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">insertRow</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-c1">3</span><span class="pl-kos">,</span> <span class="pl-s">'Sam'</span><span class="pl-kos">,</span> <span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Insert a row by sparse Array (assign to columns A, E & I)</span> <span class="pl-k">var</span> <span class="pl-s1">rowValues</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-s1">rowValues</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-c1">4</span><span class="pl-kos">;</span> <span class="pl-s1">rowValues</span><span class="pl-kos">[</span><span class="pl-c1">5</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-s">'Kyle'</span><span class="pl-kos">;</span> <span class="pl-s1">rowValues</span><span class="pl-kos">[</span><span class="pl-c1">9</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// insert new row and return as row object</span> <span class="pl-k">const</span> <span class="pl-s1">insertedRow</span> <span class="pl-c1">=</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">insertRow</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-s1">rowValues</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Insert a row, with inherited style</span> <span class="pl-c">// This new row will have same style as row on top of it</span> <span class="pl-c">// And return as row object</span> <span class="pl-k">const</span> <span class="pl-s1">insertedRowInherited</span> <span class="pl-c1">=</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">insertRow</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-s1">rowValues</span><span class="pl-kos">,</span> <span class="pl-s">'i'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Insert a row, keeping original style</span> <span class="pl-c">// This new row will have same style as it was previously</span> <span class="pl-c">// And return as row object</span> <span class="pl-k">const</span> <span class="pl-s1">insertedRowOriginal</span> <span class="pl-c1">=</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">insertRow</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-s1">rowValues</span><span class="pl-kos">,</span> <span class="pl-s">'o'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Insert an array of rows, in position 1, shifting down current position 1 and later rows by 2 rows</span> <span class="pl-k">var</span> <span class="pl-s1">rows</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span> <span class="pl-kos">[</span><span class="pl-c1">5</span><span class="pl-kos">,</span><span class="pl-s">'Bob'</span><span class="pl-kos">,</span><span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c">// row by array</span> <span class="pl-kos">{</span><span class="pl-c1">id</span>:<span class="pl-c1">6</span><span class="pl-kos">,</span> <span class="pl-c1">name</span>: <span class="pl-s">'Barbara'</span><span class="pl-kos">,</span> <span class="pl-c1">dob</span>: <span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">}</span> <span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-c">// insert new rows and return them as array of row objects</span> <span class="pl-k">const</span> <span class="pl-s1">insertedRows</span> <span class="pl-c1">=</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">insertRows</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-s1">rows</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Insert an array of rows, with inherited style</span> <span class="pl-c">// These new rows will have same style as row on top of it</span> <span class="pl-c">// And return them as array of row objects</span> <span class="pl-k">const</span> <span class="pl-s1">insertedRowsInherited</span> <span class="pl-c1">=</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">insertRows</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-s1">rows</span><span class="pl-kos">,</span> <span class="pl-s">'i'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Insert an array of rows, keeping original style</span> <span class="pl-c">// These new rows will have same style as it was previously in 'pos' position</span> <span class="pl-k">const</span> <span class="pl-s1">insertedRowsOriginal</span> <span class="pl-c1">=</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">insertRows</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-s1">rows</span><span class="pl-kos">,</span> <span class="pl-s">'o'</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <table> <thead> <tr> <th>Parameter</th> <th>Description</th> <th>Default Value</th> </tr> </thead> <tbody> <tr> <td>pos</td> <td>Row number where you want to insert, pushing down all rows from there</td> <td></td> </tr> <tr> <td>value/s</td> <td>The new row/s values</td> <td></td> </tr> <tr> <td>style</td> <td>'i' for inherit from row above, , 'i+' to include empty cells, 'o' for original style, 'o+' to include empty cells, 'n' for none</td> <td><em>'n'</em></td> </tr> </tbody> </table> <div class="markdown-heading"><h2 class="heading-element">Splice<a href="#contents">⬆</a> </h2><a id="user-content-splice" class="anchor" aria-label="Permalink: Splice⬆" href="#splice"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="highlight highlight-source-js"><pre><span class="pl-c">// Cut one or more rows (rows below are shifted up)</span> <span class="pl-c">// Known Issue: If a splice causes any merged cells to move, the results may be unpredictable</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">spliceRows</span><span class="pl-kos">(</span><span class="pl-c1">4</span><span class="pl-kos">,</span> <span class="pl-c1">3</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// remove one row and insert two more.</span> <span class="pl-c">// Note: rows 4 and below will be shifted down by 1 row.</span> <span class="pl-k">const</span> <span class="pl-s1">newRow3Values</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-c1">3</span><span class="pl-kos">,</span> <span class="pl-c1">4</span><span class="pl-kos">,</span> <span class="pl-c1">5</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">newRow4Values</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-s">'one'</span><span class="pl-kos">,</span> <span class="pl-s">'two'</span><span class="pl-kos">,</span> <span class="pl-s">'three'</span><span class="pl-kos">,</span> <span class="pl-s">'four'</span><span class="pl-kos">,</span> <span class="pl-s">'five'</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">spliceRows</span><span class="pl-kos">(</span><span class="pl-c1">3</span><span class="pl-kos">,</span> <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-s1">newRow3Values</span><span class="pl-kos">,</span> <span class="pl-s1">newRow4Values</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Cut one or more cells (cells to the right are shifted left)</span> <span class="pl-c">// Note: this operation will not affect other rows</span> <span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-en">splice</span><span class="pl-kos">(</span><span class="pl-c1">3</span><span class="pl-kos">,</span> <span class="pl-c1">2</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// remove one cell and insert two more (cells to the right of the cut cell will be shifted right)</span> <span class="pl-s1">row</span><span class="pl-kos">.</span><span class="pl-en">splice</span><span class="pl-kos">(</span><span class="pl-c1">4</span><span class="pl-kos">,</span> <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-s">'new value 1'</span><span class="pl-kos">,</span> <span class="pl-s">'new value 2'</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <table> <thead> <tr> <th>Parameter</th> <th>Description</th> <th>Default Value</th> </tr> </thead> <tbody> <tr> <td>start</td> <td>Starting point to splice from</td> <td></td> </tr> <tr> <td>count</td> <td>Number of rows/cells to remove</td> <td></td> </tr> <tr> <td>...inserts</td> <td>New row/cell values to insert</td> <td></td> </tr> </tbody> </table> <div class="markdown-heading"><h2 class="heading-element">Duplicate a Row<a href="#contents">⬆</a> </h2><a id="user-content-duplicate-a-row" class="anchor" aria-label="Permalink: Duplicate a Row⬆" href="#duplicate-a-row"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="highlight highlight-source-js"><pre><span class="pl-en">duplicateRow</span><span class="pl-kos">(</span><span class="pl-s1">start</span><span class="pl-kos">,</span> <span class="pl-s1">amount</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-s1">insert</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">)</span> <span class="pl-k">const</span> <span class="pl-s1">wb</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">ExcelJS</span><span class="pl-kos">.</span><span class="pl-c1">Workbook</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">ws</span> <span class="pl-c1">=</span> <span class="pl-s1">wb</span><span class="pl-kos">.</span><span class="pl-en">addWorksheet</span><span class="pl-kos">(</span><span class="pl-s">'duplicateTest'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-s">'One'</span><span class="pl-kos">;</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A2'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-s">'Two'</span><span class="pl-kos">;</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A3'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-s">'Three'</span><span class="pl-kos">;</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A4'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-s">'Four'</span><span class="pl-kos">;</span> <span class="pl-c">// This line will duplicate the row 'One' twice but it will replace rows 'Two' and 'Three'</span> <span class="pl-c">// if third param was true so it would insert 2 new rows with the values and styles of row 'One'</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">duplicateRow</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">,</span><span class="pl-c1">2</span><span class="pl-kos">,</span><span class="pl-c1">false</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <table> <thead> <tr> <th>Parameter</th> <th>Description</th> <th>Default Value</th> </tr> </thead> <tbody> <tr> <td>start</td> <td>Row number you want to duplicate (first in excel is 1)</td> <td></td> </tr> <tr> <td>amount</td> <td>The times you want to duplicate the row</td> <td>1</td> </tr> <tr> <td>insert</td> <td> <em>true</em> if you want to insert new rows for the duplicates, or <em>false</em> if you want to replace them</td> <td><em>true</em></td> </tr> </tbody> </table> <div class="markdown-heading"><h2 class="heading-element">Defined Names<a href="#contents">⬆</a> </h2><a id="user-content-defined-names" class="anchor" aria-label="Permalink: Defined Names⬆" href="#defined-names"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Individual cells (or multiple groups of cells) can have names assigned to them. The names can be used in formulas and data validation (and probably more).</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// assign (or get) a name for a cell (will overwrite any other names that cell had)</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">name</span> <span class="pl-c1">=</span> <span class="pl-s">'PI'</span><span class="pl-kos">;</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">name</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">to</span><span class="pl-kos">.</span><span class="pl-en">equal</span><span class="pl-kos">(</span><span class="pl-s">'PI'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// assign (or get) an array of names for a cell (cells can have more than one name)</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">names</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-s">'thing1'</span><span class="pl-kos">,</span> <span class="pl-s">'thing2'</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">names</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">to</span><span class="pl-kos">.</span><span class="pl-c1">have</span><span class="pl-kos">.</span><span class="pl-en">members</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-s">'thing1'</span><span class="pl-kos">,</span> <span class="pl-s">'thing2'</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// remove a name from a cell</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">removeName</span><span class="pl-kos">(</span><span class="pl-s">'thing1'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">names</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">to</span><span class="pl-kos">.</span><span class="pl-c1">have</span><span class="pl-kos">.</span><span class="pl-en">members</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-s">'thing2'</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Data Validations<a href="#contents">⬆</a> </h2><a id="user-content-data-validations" class="anchor" aria-label="Permalink: Data Validations⬆" href="#data-validations"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Cells can define what values are valid or not and provide prompting to the user to help guide them.</p> <p>Validation types can be one of the following:</p> <table> <thead> <tr> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>list</td> <td>Define a discrete set of valid values. Excel will offer these in a dropdown for easy entry</td> </tr> <tr> <td>whole</td> <td>The value must be a whole number</td> </tr> <tr> <td>decimal</td> <td>The value must be a decimal number</td> </tr> <tr> <td>textLength</td> <td>The value may be text but the length is controlled</td> </tr> <tr> <td>custom</td> <td>A custom formula controls the valid values</td> </tr> </tbody> </table> <p>For types other than list or custom, the following operators affect the validation:</p> <table> <thead> <tr> <th>Operator</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>between</td> <td>Values must lie between formula results</td> </tr> <tr> <td>notBetween</td> <td>Values must not lie between formula results</td> </tr> <tr> <td>equal</td> <td>Value must equal formula result</td> </tr> <tr> <td>notEqual</td> <td>Value must not equal formula result</td> </tr> <tr> <td>greaterThan</td> <td>Value must be greater than formula result</td> </tr> <tr> <td>lessThan</td> <td>Value must be less than formula result</td> </tr> <tr> <td>greaterThanOrEqual</td> <td>Value must be greater than or equal to formula result</td> </tr> <tr> <td>lessThanOrEqual</td> <td>Value must be less than or equal to formula result</td> </tr> </tbody> </table> <div class="highlight highlight-source-js"><pre><span class="pl-c">// Specify list of valid values (One, Two, Three, Four).</span> <span class="pl-c">// Excel will provide a dropdown with these values.</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">dataValidation</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">type</span>: <span class="pl-s">'list'</span><span class="pl-kos">,</span> <span class="pl-c1">allowBlank</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">formulae</span>: <span class="pl-kos">[</span><span class="pl-s">'"One,Two,Three,Four"'</span><span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// Specify list of valid values from a range.</span> <span class="pl-c">// Excel will provide a dropdown with these values.</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">dataValidation</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">type</span>: <span class="pl-s">'list'</span><span class="pl-kos">,</span> <span class="pl-c1">allowBlank</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">formulae</span>: <span class="pl-kos">[</span><span class="pl-s">'$D$5:$F$5'</span><span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// Specify Cell must be a whole number that is not 5.</span> <span class="pl-c">// Show the user an appropriate error message if they get it wrong</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">dataValidation</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">type</span>: <span class="pl-s">'whole'</span><span class="pl-kos">,</span> <span class="pl-c1">operator</span>: <span class="pl-s">'notEqual'</span><span class="pl-kos">,</span> <span class="pl-c1">showErrorMessage</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">formulae</span>: <span class="pl-kos">[</span><span class="pl-c1">5</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c1">errorStyle</span>: <span class="pl-s">'error'</span><span class="pl-kos">,</span> <span class="pl-c1">errorTitle</span>: <span class="pl-s">'Five'</span><span class="pl-kos">,</span> <span class="pl-c1">error</span>: <span class="pl-s">'The value must not be Five'</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// Specify Cell must be a decimal number between 1.5 and 7.</span> <span class="pl-c">// Add 'tooltip' to help guid the user</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">dataValidation</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">type</span>: <span class="pl-s">'decimal'</span><span class="pl-kos">,</span> <span class="pl-c1">operator</span>: <span class="pl-s">'between'</span><span class="pl-kos">,</span> <span class="pl-c1">allowBlank</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">showInputMessage</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">formulae</span>: <span class="pl-kos">[</span><span class="pl-c1">1.5</span><span class="pl-kos">,</span> <span class="pl-c1">7</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c1">promptTitle</span>: <span class="pl-s">'Decimal'</span><span class="pl-kos">,</span> <span class="pl-c1">prompt</span>: <span class="pl-s">'The value must between 1.5 and 7'</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// Specify Cell must be have a text length less than 15</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">dataValidation</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">type</span>: <span class="pl-s">'textLength'</span><span class="pl-kos">,</span> <span class="pl-c1">operator</span>: <span class="pl-s">'lessThan'</span><span class="pl-kos">,</span> <span class="pl-c1">showErrorMessage</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">allowBlank</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">formulae</span>: <span class="pl-kos">[</span><span class="pl-c1">15</span><span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// Specify Cell must be have be a date before 1st Jan 2016</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">dataValidation</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">type</span>: <span class="pl-s">'date'</span><span class="pl-kos">,</span> <span class="pl-c1">operator</span>: <span class="pl-s">'lessThan'</span><span class="pl-kos">,</span> <span class="pl-c1">showErrorMessage</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">allowBlank</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">formulae</span>: <span class="pl-kos">[</span><span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-c1">2016</span><span class="pl-kos">,</span><span class="pl-c1">0</span><span class="pl-kos">,</span><span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Cell Comments<a href="#contents">⬆</a> </h2><a id="user-content-cell-comments" class="anchor" aria-label="Permalink: Cell Comments⬆" href="#cell-comments"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Add old style comment to a cell</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// plain text note</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">note</span> <span class="pl-c1">=</span> <span class="pl-s">'Hello, ExcelJS!'</span><span class="pl-kos">;</span> <span class="pl-c">// colourful formatted note</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'B1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">note</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">texts</span>: <span class="pl-kos">[</span> <span class="pl-kos">{</span><span class="pl-s">'font'</span>: <span class="pl-kos">{</span><span class="pl-s">'size'</span>: <span class="pl-c1">12</span><span class="pl-kos">,</span> <span class="pl-s">'color'</span>: <span class="pl-kos">{</span><span class="pl-s">'theme'</span>: <span class="pl-c1">0</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'name'</span>: <span class="pl-s">'Calibri'</span><span class="pl-kos">,</span> <span class="pl-s">'family'</span>: <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-s">'scheme'</span>: <span class="pl-s">'minor'</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'text'</span>: <span class="pl-s">'This is '</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-s">'font'</span>: <span class="pl-kos">{</span><span class="pl-s">'italic'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-s">'size'</span>: <span class="pl-c1">12</span><span class="pl-kos">,</span> <span class="pl-s">'color'</span>: <span class="pl-kos">{</span><span class="pl-s">'theme'</span>: <span class="pl-c1">0</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'name'</span>: <span class="pl-s">'Calibri'</span><span class="pl-kos">,</span> <span class="pl-s">'scheme'</span>: <span class="pl-s">'minor'</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'text'</span>: <span class="pl-s">'a'</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-s">'font'</span>: <span class="pl-kos">{</span><span class="pl-s">'size'</span>: <span class="pl-c1">12</span><span class="pl-kos">,</span> <span class="pl-s">'color'</span>: <span class="pl-kos">{</span><span class="pl-s">'theme'</span>: <span class="pl-c1">1</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'name'</span>: <span class="pl-s">'Calibri'</span><span class="pl-kos">,</span> <span class="pl-s">'family'</span>: <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-s">'scheme'</span>: <span class="pl-s">'minor'</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'text'</span>: <span class="pl-s">' '</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-s">'font'</span>: <span class="pl-kos">{</span><span class="pl-s">'size'</span>: <span class="pl-c1">12</span><span class="pl-kos">,</span> <span class="pl-s">'color'</span>: <span class="pl-kos">{</span><span class="pl-s">'argb'</span>: <span class="pl-s">'FFFF6600'</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'name'</span>: <span class="pl-s">'Calibri'</span><span class="pl-kos">,</span> <span class="pl-s">'scheme'</span>: <span class="pl-s">'minor'</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'text'</span>: <span class="pl-s">'colorful'</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-s">'font'</span>: <span class="pl-kos">{</span><span class="pl-s">'size'</span>: <span class="pl-c1">12</span><span class="pl-kos">,</span> <span class="pl-s">'color'</span>: <span class="pl-kos">{</span><span class="pl-s">'theme'</span>: <span class="pl-c1">1</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'name'</span>: <span class="pl-s">'Calibri'</span><span class="pl-kos">,</span> <span class="pl-s">'family'</span>: <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-s">'scheme'</span>: <span class="pl-s">'minor'</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'text'</span>: <span class="pl-s">' text '</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-s">'font'</span>: <span class="pl-kos">{</span><span class="pl-s">'size'</span>: <span class="pl-c1">12</span><span class="pl-kos">,</span> <span class="pl-s">'color'</span>: <span class="pl-kos">{</span><span class="pl-s">'argb'</span>: <span class="pl-s">'FFCCFFCC'</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'name'</span>: <span class="pl-s">'Calibri'</span><span class="pl-kos">,</span> <span class="pl-s">'scheme'</span>: <span class="pl-s">'minor'</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'text'</span>: <span class="pl-s">'with'</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-s">'font'</span>: <span class="pl-kos">{</span><span class="pl-s">'size'</span>: <span class="pl-c1">12</span><span class="pl-kos">,</span> <span class="pl-s">'color'</span>: <span class="pl-kos">{</span><span class="pl-s">'theme'</span>: <span class="pl-c1">1</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'name'</span>: <span class="pl-s">'Calibri'</span><span class="pl-kos">,</span> <span class="pl-s">'family'</span>: <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-s">'scheme'</span>: <span class="pl-s">'minor'</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'text'</span>: <span class="pl-s">' in-cell '</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-s">'font'</span>: <span class="pl-kos">{</span><span class="pl-s">'bold'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-s">'size'</span>: <span class="pl-c1">12</span><span class="pl-kos">,</span> <span class="pl-s">'color'</span>: <span class="pl-kos">{</span><span class="pl-s">'theme'</span>: <span class="pl-c1">1</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'name'</span>: <span class="pl-s">'Calibri'</span><span class="pl-kos">,</span> <span class="pl-s">'family'</span>: <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-s">'scheme'</span>: <span class="pl-s">'minor'</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s">'text'</span>: <span class="pl-s">'format'</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c1">margins</span>: <span class="pl-kos">{</span> <span class="pl-c1">insetmode</span>: <span class="pl-s">'custom'</span><span class="pl-kos">,</span> <span class="pl-c1">inset</span>: <span class="pl-kos">[</span><span class="pl-c1">0.25</span><span class="pl-kos">,</span> <span class="pl-c1">0.25</span><span class="pl-kos">,</span> <span class="pl-c1">0.35</span><span class="pl-kos">,</span> <span class="pl-c1">0.35</span><span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">protection</span>: <span class="pl-kos">{</span> <span class="pl-c1">locked</span>: <span class="pl-v">True</span><span class="pl-kos">,</span> <span class="pl-c1">lockText</span>: <span class="pl-v">False</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">editAs</span>: <span class="pl-s">'twoCells'</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Cell Comments Properties<a href="#contents">⬆</a> </h3><a id="user-content-cell-comments-properties" class="anchor" aria-label="Permalink: Cell Comments Properties⬆" href="#cell-comments-properties"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>The following table defines the properties supported by cell comments.</p> <table> <thead> <tr> <th>Field</th> <th>Required</th> <th>Default Value</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>texts</td> <td>Y</td> <td></td> <td>The text of the comment</td> </tr> <tr> <td>margins</td> <td>N</td> <td>{}</td> <td>Determines the value of margins for automatic or custom cell comments</td> </tr> <tr> <td>protection</td> <td>N</td> <td>{}</td> <td>Specifying the lock status of objects and object text using protection attributes</td> </tr> <tr> <td>editAs</td> <td>N</td> <td>'absolute'</td> <td>Use the 'editAs' attribute to specify how the annotation is anchored to the cell</td> </tr> </tbody> </table> <div class="markdown-heading"><h3 class="heading-element">Cell Comments Margins</h3><a id="user-content-cell-comments-margins" class="anchor" aria-label="Permalink: Cell Comments Margins" href="#cell-comments-margins"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Determine the page margin setting mode of the cell annotation, automatic or custom mode.</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'B1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">note</span><span class="pl-kos">.</span><span class="pl-c1">margins</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">insetmode</span>: <span class="pl-s">'custom'</span><span class="pl-kos">,</span> <span class="pl-c1">inset</span>: <span class="pl-kos">[</span><span class="pl-c1">0.25</span><span class="pl-kos">,</span> <span class="pl-c1">0.25</span><span class="pl-kos">,</span> <span class="pl-c1">0.35</span><span class="pl-kos">,</span> <span class="pl-c1">0.35</span><span class="pl-kos">]</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Supported Margins Properties<a href="#contents">⬆</a> </h3><a id="user-content-supported-margins-properties" class="anchor" aria-label="Permalink: Supported Margins Properties⬆" href="#supported-margins-properties"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <table> <thead> <tr> <th>Property</th> <th>Required</th> <th>Default Value</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>insetmode</td> <td>N</td> <td>'auto'</td> <td>Determines whether comment margins are set automatically and the value is 'auto' or 'custom'</td> </tr> <tr> <td>inset</td> <td>N</td> <td>[0.13, 0.13, 0.25, 0.25]</td> <td>Whitespace on the borders of the comment. Units are centimeter. Direction is left, top, right, bottom</td> </tr> </tbody> </table> <p>Note: This <code>inset</code> setting takes effect only when the value of <code>insetmode</code> is 'custom'.</p> <div class="markdown-heading"><h3 class="heading-element">Cell Comments Protection</h3><a id="user-content-cell-comments-protection" class="anchor" aria-label="Permalink: Cell Comments Protection" href="#cell-comments-protection"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Specifying the lock status of objects and object text using protection attributes.</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'B1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">note</span><span class="pl-kos">.</span><span class="pl-c1">protection</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">locked</span>: <span class="pl-s">'False'</span><span class="pl-kos">,</span> <span class="pl-c1">lockText</span>: <span class="pl-s">'False'</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Supported Protection Properties<a href="#contents">⬆</a> </h3><a id="user-content-supported-protection-properties" class="anchor" aria-label="Permalink: Supported Protection Properties⬆" href="#supported-protection-properties"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <table> <thead> <tr> <th>Property</th> <th>Required</th> <th>Default Value</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>locked</td> <td>N</td> <td>'True'</td> <td>This element specifies that the object is locked when the sheet is protected</td> </tr> <tr> <td>lockText</td> <td>N</td> <td>'True'</td> <td>This element specifies that the text of the object is locked</td> </tr> </tbody> </table> <p>Note: Locked objects are valid only when the worksheet is protected.</p> <div class="markdown-heading"><h3 class="heading-element">Cell Comments EditAs<a href="#contents">⬆</a> </h3><a id="user-content-cell-comments-editas" class="anchor" aria-label="Permalink: Cell Comments EditAs⬆" href="#cell-comments-editas"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>The cell comments can also have the property 'editAs' which will control how the comments is anchored to the cell(s). It can have one of the following values:</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'B1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">note</span><span class="pl-kos">.</span><span class="pl-c1">editAs</span> <span class="pl-c1">=</span> <span class="pl-s">'twoCells'</span><span class="pl-kos">;</span></pre></div> <table> <thead> <tr> <th>Value</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>twoCells</td> <td>It specifies that the size and position of the note varies with cells</td> </tr> <tr> <td>oneCells</td> <td>It specifies that the size of the note is fixed and the position changes with the cell</td> </tr> <tr> <td>absolute</td> <td>This is the default. Comments will not be moved or sized with cells</td> </tr> </tbody> </table> <div class="markdown-heading"><h2 class="heading-element">Tables<a href="#contents">⬆</a> </h2><a id="user-content-tables" class="anchor" aria-label="Permalink: Tables⬆" href="#tables"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Tables allow for in-sheet manipulation of tabular data.</p> <p>To add a table to a worksheet, define a table model and call addTable:</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// add a table to a sheet</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">addTable</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">'MyTable'</span><span class="pl-kos">,</span> <span class="pl-c1">ref</span>: <span class="pl-s">'A1'</span><span class="pl-kos">,</span> <span class="pl-c1">headerRow</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">totalsRow</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">style</span>: <span class="pl-kos">{</span> <span class="pl-c1">theme</span>: <span class="pl-s">'TableStyleDark3'</span><span class="pl-kos">,</span> <span class="pl-c1">showRowStripes</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">columns</span>: <span class="pl-kos">[</span> <span class="pl-kos">{</span><span class="pl-c1">name</span>: <span class="pl-s">'Date'</span><span class="pl-kos">,</span> <span class="pl-c1">totalsRowLabel</span>: <span class="pl-s">'Totals:'</span><span class="pl-kos">,</span> <span class="pl-c1">filterButton</span>: <span class="pl-c1">true</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-c1">name</span>: <span class="pl-s">'Amount'</span><span class="pl-kos">,</span> <span class="pl-c1">totalsRowFunction</span>: <span class="pl-s">'sum'</span><span class="pl-kos">,</span> <span class="pl-c1">filterButton</span>: <span class="pl-c1">false</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c1">rows</span>: <span class="pl-kos">[</span> <span class="pl-kos">[</span><span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-s">'2019-07-20'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">70.10</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-s">'2019-07-21'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">70.60</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-s">'2019-07-22'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">70.10</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p>Note: Adding a table to a worksheet will modify the sheet by placing headers and row data to the sheet. Any data on the sheet covered by the resulting table (including headers and totals) will be overwritten.</p> <div class="markdown-heading"><h3 class="heading-element">Table Properties<a href="#contents">⬆</a> </h3><a id="user-content-table-properties" class="anchor" aria-label="Permalink: Table Properties⬆" href="#table-properties"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>The following table defines the properties supported by tables.</p> <table> <thead> <tr> <th>Table Property</th> <th>Description</th> <th>Required</th> <th>Default Value</th> </tr> </thead> <tbody> <tr> <td>name</td> <td>The name of the table</td> <td>Y</td> <td></td> </tr> <tr> <td>displayName</td> <td>The display name of the table</td> <td>N</td> <td>name</td> </tr> <tr> <td>ref</td> <td>Top left cell of the table</td> <td>Y</td> <td></td> </tr> <tr> <td>headerRow</td> <td>Show headers at top of table</td> <td>N</td> <td>true</td> </tr> <tr> <td>totalsRow</td> <td>Show totals at bottom of table</td> <td>N</td> <td>false</td> </tr> <tr> <td>style</td> <td>Extra style properties</td> <td>N</td> <td>{}</td> </tr> <tr> <td>columns</td> <td>Column definitions</td> <td>Y</td> <td></td> </tr> <tr> <td>rows</td> <td>Rows of data</td> <td>Y</td> <td></td> </tr> </tbody> </table> <div class="markdown-heading"><h3 class="heading-element">Table Style Properties<a href="#contents">⬆</a> </h3><a id="user-content-table-style-properties" class="anchor" aria-label="Permalink: Table Style Properties⬆" href="#table-style-properties"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>The following table defines the properties supported within the table style property.</p> <table> <thead> <tr> <th>Style Property</th> <th>Description</th> <th>Required</th> <th>Default Value</th> </tr> </thead> <tbody> <tr> <td>theme</td> <td>The colour theme of the table</td> <td>N</td> <td>'TableStyleMedium2'</td> </tr> <tr> <td>showFirstColumn</td> <td>Highlight the first column (bold)</td> <td>N</td> <td>false</td> </tr> <tr> <td>showLastColumn</td> <td>Highlight the last column (bold)</td> <td>N</td> <td>false</td> </tr> <tr> <td>showRowStripes</td> <td>Alternate rows shown with background colour</td> <td>N</td> <td>false</td> </tr> <tr> <td>showColumnStripes</td> <td>Alternate rows shown with background colour</td> <td>N</td> <td>false</td> </tr> </tbody> </table> <div class="markdown-heading"><h3 class="heading-element">Table Column Properties<a href="#contents">⬆</a> </h3><a id="user-content-table-column-properties" class="anchor" aria-label="Permalink: Table Column Properties⬆" href="#table-column-properties"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>The following table defines the properties supported within each table column.</p> <table> <thead> <tr> <th>Column Property</th> <th>Description</th> <th>Required</th> <th>Default Value</th> </tr> </thead> <tbody> <tr> <td>name</td> <td>The name of the column, also used in the header</td> <td>Y</td> <td></td> </tr> <tr> <td>filterButton</td> <td>Switches the filter control in the header</td> <td>N</td> <td>false</td> </tr> <tr> <td>totalsRowLabel</td> <td>Label to describe the totals row (first column)</td> <td>N</td> <td>'Total'</td> </tr> <tr> <td>totalsRowFunction</td> <td>Name of the totals function</td> <td>N</td> <td>'none'</td> </tr> <tr> <td>totalsRowFormula</td> <td>Optional formula for custom functions</td> <td>N</td> <td></td> </tr> </tbody> </table> <div class="markdown-heading"><h3 class="heading-element">Totals Functions<a href="#contents">⬆</a> </h3><a id="user-content-totals-functions" class="anchor" aria-label="Permalink: Totals Functions⬆" href="#totals-functions"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>The following table list the valid values for the totalsRowFunction property defined by columns. If any value other than 'custom' is used, it is not necessary to include the associated formula as this will be inserted by the table.</p> <table> <thead> <tr> <th>Totals Functions</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>none</td> <td>No totals function for this column</td> </tr> <tr> <td>average</td> <td>Compute average for the column</td> </tr> <tr> <td>countNums</td> <td>Count the entries that are numbers</td> </tr> <tr> <td>count</td> <td>Count of entries</td> </tr> <tr> <td>max</td> <td>The maximum value in this column</td> </tr> <tr> <td>min</td> <td>The minimum value in this column</td> </tr> <tr> <td>stdDev</td> <td>The standard deviation for this column</td> </tr> <tr> <td>var</td> <td>The variance for this column</td> </tr> <tr> <td>sum</td> <td>The sum of entries for this column</td> </tr> <tr> <td>custom</td> <td>A custom formula. Requires an associated totalsRowFormula value.</td> </tr> </tbody> </table> <div class="markdown-heading"><h3 class="heading-element">Table Style Themes<a href="#contents">⬆</a> </h3><a id="user-content-table-style-themes" class="anchor" aria-label="Permalink: Table Style Themes⬆" href="#table-style-themes"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Valid theme names follow the following pattern:</p> <ul> <li>"TableStyle[Shade][Number]"</li> </ul> <p>Shades, Numbers can be one of:</p> <ul> <li>Light, 1-21</li> <li>Medium, 1-28</li> <li>Dark, 1-11</li> </ul> <p>For no theme, use the value null.</p> <p>Note: custom table themes are not supported by exceljs yet.</p> <div class="markdown-heading"><h3 class="heading-element">Modifying Tables<a href="#contents">⬆</a> </h3><a id="user-content-modifying-tables" class="anchor" aria-label="Permalink: Modifying Tables⬆" href="#modifying-tables"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Tables support a set of manipulation functions that allow data to be added or removed and some properties to be changed. Since many of these operations may have on-sheet effects, the changes must be committed once complete.</p> <p>All index values in the table are zero based, so the first row number and first column number is 0.</p> <p><strong>Adding or Removing Headers and Totals</strong></p> <div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-s1">table</span> <span class="pl-c1">=</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getTable</span><span class="pl-kos">(</span><span class="pl-s">'MyTable'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// turn header row on</span> <span class="pl-s1">table</span><span class="pl-kos">.</span><span class="pl-c1">headerRow</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span> <span class="pl-c">// turn totals row off</span> <span class="pl-s1">table</span><span class="pl-kos">.</span><span class="pl-c1">totalsRow</span> <span class="pl-c1">=</span> <span class="pl-c1">false</span><span class="pl-kos">;</span> <span class="pl-c">// commit the table changes into the sheet</span> <span class="pl-s1">table</span><span class="pl-kos">.</span><span class="pl-en">commit</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p><strong>Relocating a Table</strong></p> <div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-s1">table</span> <span class="pl-c1">=</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getTable</span><span class="pl-kos">(</span><span class="pl-s">'MyTable'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// table top-left move to D4</span> <span class="pl-s1">table</span><span class="pl-kos">.</span><span class="pl-c1">ref</span> <span class="pl-c1">=</span> <span class="pl-s">'D4'</span><span class="pl-kos">;</span> <span class="pl-c">// commit the table changes into the sheet</span> <span class="pl-s1">table</span><span class="pl-kos">.</span><span class="pl-en">commit</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p><strong>Adding and Removing Rows</strong></p> <div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-s1">table</span> <span class="pl-c1">=</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getTable</span><span class="pl-kos">(</span><span class="pl-s">'MyTable'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// remove first two rows</span> <span class="pl-s1">table</span><span class="pl-kos">.</span><span class="pl-en">removeRows</span><span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-c1">2</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// insert new rows at index 5</span> <span class="pl-s1">table</span><span class="pl-kos">.</span><span class="pl-en">addRow</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-s">'2019-08-05'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">5</span><span class="pl-kos">,</span> <span class="pl-s">'Mid'</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c1">5</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// append new row to bottom of table</span> <span class="pl-s1">table</span><span class="pl-kos">.</span><span class="pl-en">addRow</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-s">'2019-08-10'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">10</span><span class="pl-kos">,</span> <span class="pl-s">'End'</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// commit the table changes into the sheet</span> <span class="pl-s1">table</span><span class="pl-kos">.</span><span class="pl-en">commit</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p><strong>Adding and Removing Columns</strong></p> <div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-s1">table</span> <span class="pl-c1">=</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getTable</span><span class="pl-kos">(</span><span class="pl-s">'MyTable'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// remove second column</span> <span class="pl-s1">table</span><span class="pl-kos">.</span><span class="pl-en">removeColumns</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// insert new column (with data) at index 1</span> <span class="pl-s1">table</span><span class="pl-kos">.</span><span class="pl-en">addColumn</span><span class="pl-kos">(</span> <span class="pl-kos">{</span><span class="pl-c1">name</span>: <span class="pl-s">'Letter'</span><span class="pl-kos">,</span> <span class="pl-c1">totalsRowFunction</span>: <span class="pl-s">'custom'</span><span class="pl-kos">,</span> <span class="pl-c1">totalsRowFormula</span>: <span class="pl-s">'ROW()'</span><span class="pl-kos">,</span> <span class="pl-c1">totalsRowResult</span>: <span class="pl-c1">6</span><span class="pl-kos">,</span> <span class="pl-c1">filterButton</span>: <span class="pl-c1">true</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s">'a'</span><span class="pl-kos">,</span> <span class="pl-s">'b'</span><span class="pl-kos">,</span> <span class="pl-s">'c'</span><span class="pl-kos">,</span> <span class="pl-s">'d'</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c1">2</span> <span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// commit the table changes into the sheet</span> <span class="pl-s1">table</span><span class="pl-kos">.</span><span class="pl-en">commit</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p><strong>Change Column Properties</strong></p> <div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-s1">table</span> <span class="pl-c1">=</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getTable</span><span class="pl-kos">(</span><span class="pl-s">'MyTable'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Get Column Wrapper for second column</span> <span class="pl-k">const</span> <span class="pl-s1">column</span> <span class="pl-c1">=</span> <span class="pl-s1">table</span><span class="pl-kos">.</span><span class="pl-en">getColumn</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// set some properties</span> <span class="pl-s1">column</span><span class="pl-kos">.</span><span class="pl-c1">name</span> <span class="pl-c1">=</span> <span class="pl-s">'Code'</span><span class="pl-kos">;</span> <span class="pl-s1">column</span><span class="pl-kos">.</span><span class="pl-c1">filterButton</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span> <span class="pl-s1">column</span><span class="pl-kos">.</span><span class="pl-c1">style</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-c1">font</span>:<span class="pl-kos">{</span><span class="pl-c1">bold</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">name</span>: <span class="pl-s">'Comic Sans MS'</span><span class="pl-kos">}</span><span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-s1">column</span><span class="pl-kos">.</span><span class="pl-c1">totalsRowLabel</span> <span class="pl-c1">=</span> <span class="pl-s">'Totals'</span><span class="pl-kos">;</span> <span class="pl-s1">column</span><span class="pl-kos">.</span><span class="pl-c1">totalsRowFunction</span> <span class="pl-c1">=</span> <span class="pl-s">'custom'</span><span class="pl-kos">;</span> <span class="pl-s1">column</span><span class="pl-kos">.</span><span class="pl-c1">totalsRowFormula</span> <span class="pl-c1">=</span> <span class="pl-s">'ROW()'</span><span class="pl-kos">;</span> <span class="pl-s1">column</span><span class="pl-kos">.</span><span class="pl-c1">totalsRowResult</span> <span class="pl-c1">=</span> <span class="pl-c1">10</span><span class="pl-kos">;</span> <span class="pl-c">// commit the table changes into the sheet</span> <span class="pl-s1">table</span><span class="pl-kos">.</span><span class="pl-en">commit</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Styles<a href="#contents">⬆</a> </h2><a id="user-content-styles" class="anchor" aria-label="Permalink: Styles⬆" href="#styles"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Cells, Rows and Columns each support a rich set of styles and formats that affect how the cells are displayed.</p> <p>Styles are set by assigning the following properties:</p> <ul> <li><a href="#number-formats">numFmt</a></li> <li><a href="#fonts">font</a></li> <li><a href="#alignment">alignment</a></li> <li><a href="#borders">border</a></li> <li><a href="#fills">fill</a></li> </ul> <div class="highlight highlight-source-js"><pre><span class="pl-c">// assign a style to a cell</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">numFmt</span> <span class="pl-c1">=</span> <span class="pl-s">'0.00%'</span><span class="pl-kos">;</span> <span class="pl-c">// Apply styles to worksheet columns</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-c1">columns</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span> <span class="pl-kos">{</span> <span class="pl-c1">header</span>: <span class="pl-s">'Id'</span><span class="pl-kos">,</span> <span class="pl-c1">key</span>: <span class="pl-s">'id'</span><span class="pl-kos">,</span> <span class="pl-c1">width</span>: <span class="pl-c1">10</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">header</span>: <span class="pl-s">'Name'</span><span class="pl-kos">,</span> <span class="pl-c1">key</span>: <span class="pl-s">'name'</span><span class="pl-kos">,</span> <span class="pl-c1">width</span>: <span class="pl-c1">32</span><span class="pl-kos">,</span> <span class="pl-c1">style</span>: <span class="pl-kos">{</span> <span class="pl-c1">font</span>: <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">'Arial Black'</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">header</span>: <span class="pl-s">'D.O.B.'</span><span class="pl-kos">,</span> <span class="pl-c1">key</span>: <span class="pl-s">'DOB'</span><span class="pl-kos">,</span> <span class="pl-c1">width</span>: <span class="pl-c1">10</span><span class="pl-kos">,</span> <span class="pl-c1">style</span>: <span class="pl-kos">{</span> <span class="pl-c1">numFmt</span>: <span class="pl-s">'dd/mm/yyyy'</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span> <span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-c">// Set Column 3 to Currency Format</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getColumn</span><span class="pl-kos">(</span><span class="pl-c1">3</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">numFmt</span> <span class="pl-c1">=</span> <span class="pl-s">'"£"#,##0.00;[Red]\-"£"#,##0.00'</span><span class="pl-kos">;</span> <span class="pl-c">// Set Row 2 to Comic Sans.</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getRow</span><span class="pl-kos">(</span><span class="pl-c1">2</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">font</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">'Comic Sans MS'</span><span class="pl-kos">,</span> <span class="pl-c1">family</span>: <span class="pl-c1">4</span><span class="pl-kos">,</span> <span class="pl-c1">size</span>: <span class="pl-c1">16</span><span class="pl-kos">,</span> <span class="pl-c1">underline</span>: <span class="pl-s">'double'</span><span class="pl-kos">,</span> <span class="pl-c1">bold</span>: <span class="pl-c1">true</span> <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div> <p>When a style is applied to a row or column, it will be applied to all currently existing cells in that row or column. Also, any new cell that is created will inherit its initial styles from the row and column it belongs to.</p> <p>If a cell's row and column both define a specific style (e.g. font), the cell will use the row style over the column style. However if the row and column define different styles (e.g. column.numFmt and row.font), the cell will inherit the font from the row and the numFmt from the column.</p> <p>Caveat: All the above properties (with the exception of numFmt, which is a string), are JS object structures. If the same style object is assigned to more than one spreadsheet entity, then each entity will share the same style object. If the style object is later modified before the spreadsheet is serialized, then all entities referencing that style object will be modified too. This behaviour is intended to prioritize performance by reducing the number of JS objects created. If you want the style objects to be independent, you will need to clone them before assigning them. Also, by default, when a document is read from file (or stream) if spreadsheet entities share similar styles, then they will reference the same style object too.</p> <div class="markdown-heading"><h3 class="heading-element">Number Formats<a href="#contents">⬆</a> </h3><a id="user-content-number-formats" class="anchor" aria-label="Permalink: Number Formats⬆" href="#number-formats"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="highlight highlight-source-js"><pre><span class="pl-c">// display value as '1 3/5'</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-c1">1.6</span><span class="pl-kos">;</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">numFmt</span> <span class="pl-c1">=</span> <span class="pl-s">'# ?/?'</span><span class="pl-kos">;</span> <span class="pl-c">// display value as '1.60%'</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'B1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-c1">0.016</span><span class="pl-kos">;</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'B1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">numFmt</span> <span class="pl-c1">=</span> <span class="pl-s">'0.00%'</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Fonts<a href="#contents">⬆</a> </h3><a id="user-content-fonts" class="anchor" aria-label="Permalink: Fonts⬆" href="#fonts"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="highlight highlight-source-js"><pre><span class="pl-c">// for the wannabe graphic designers out there</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">font</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">'Comic Sans MS'</span><span class="pl-kos">,</span> <span class="pl-c1">family</span>: <span class="pl-c1">4</span><span class="pl-kos">,</span> <span class="pl-c1">size</span>: <span class="pl-c1">16</span><span class="pl-kos">,</span> <span class="pl-c1">underline</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">bold</span>: <span class="pl-c1">true</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// for the graduate graphic designers...</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A2'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">font</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">'Arial Black'</span><span class="pl-kos">,</span> <span class="pl-c1">color</span>: <span class="pl-kos">{</span> <span class="pl-c1">argb</span>: <span class="pl-s">'FF00FF00'</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">family</span>: <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-c1">size</span>: <span class="pl-c1">14</span><span class="pl-kos">,</span> <span class="pl-c1">italic</span>: <span class="pl-c1">true</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// for the vertical align</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A3'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">font</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">vertAlign</span>: <span class="pl-s">'superscript'</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// note: the cell will store a reference to the font object assigned.</span> <span class="pl-c">// If the font object is changed afterwards, the cell font will change also...</span> <span class="pl-k">const</span> <span class="pl-s1">font</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">'Arial'</span><span class="pl-kos">,</span> <span class="pl-c1">size</span>: <span class="pl-c1">12</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A3'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">font</span> <span class="pl-c1">=</span> <span class="pl-s1">font</span><span class="pl-kos">;</span> <span class="pl-s1">font</span><span class="pl-kos">.</span><span class="pl-c1">size</span> <span class="pl-c1">=</span> <span class="pl-c1">20</span><span class="pl-kos">;</span> <span class="pl-c">// Cell A3 now has font size 20!</span> <span class="pl-c">// Cells that share similar fonts may reference the same font object after</span> <span class="pl-c">// the workbook is read from file or stream</span></pre></div> <table> <thead> <tr> <th>Font Property</th> <th>Description</th> <th>Example Value(s)</th> </tr> </thead> <tbody> <tr> <td>name</td> <td>Font name.</td> <td>'Arial', 'Calibri', etc.</td> </tr> <tr> <td>family</td> <td>Font family for fallback. An integer value.</td> <td>1 - Serif, 2 - Sans Serif, 3 - Mono, Others - unknown</td> </tr> <tr> <td>scheme</td> <td>Font scheme.</td> <td>'minor', 'major', 'none'</td> </tr> <tr> <td>charset</td> <td>Font charset. An integer value.</td> <td>1, 2, etc.</td> </tr> <tr> <td>size</td> <td>Font size. An integer value.</td> <td>9, 10, 12, 16, etc.</td> </tr> <tr> <td>color</td> <td>Colour description, an object containing an ARGB value.</td> <td>{ argb: 'FFFF0000'}</td> </tr> <tr> <td>bold</td> <td>Font <strong>weight</strong> </td> <td>true, false</td> </tr> <tr> <td>italic</td> <td>Font <em>slope</em> </td> <td>true, false</td> </tr> <tr> <td>underline</td> <td>Font underline style</td> <td>true, false, 'none', 'single', 'double', 'singleAccounting', 'doubleAccounting'</td> </tr> <tr> <td>strike</td> <td>Font <strike>strikethrough</strike> </td> <td>true, false</td> </tr> <tr> <td>outline</td> <td>Font outline</td> <td>true, false</td> </tr> <tr> <td>vertAlign</td> <td>Vertical align</td> <td>'superscript', 'subscript'</td> </tr> </tbody> </table> <div class="markdown-heading"><h3 class="heading-element">Alignment<a href="#contents">⬆</a> </h3><a id="user-content-alignment" class="anchor" aria-label="Permalink: Alignment⬆" href="#alignment"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="highlight highlight-source-js"><pre><span class="pl-c">// set cell alignment to top-left, middle-center, bottom-right</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">alignment</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">vertical</span>: <span class="pl-s">'top'</span><span class="pl-kos">,</span> <span class="pl-c1">horizontal</span>: <span class="pl-s">'left'</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'B1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">alignment</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">vertical</span>: <span class="pl-s">'middle'</span><span class="pl-kos">,</span> <span class="pl-c1">horizontal</span>: <span class="pl-s">'center'</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'C1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">alignment</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">vertical</span>: <span class="pl-s">'bottom'</span><span class="pl-kos">,</span> <span class="pl-c1">horizontal</span>: <span class="pl-s">'right'</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// set cell to wrap-text</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'D1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">alignment</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">wrapText</span>: <span class="pl-c1">true</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// set cell indent to 1</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'E1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">alignment</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">indent</span>: <span class="pl-c1">1</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// set cell text rotation to 30deg upwards, 45deg downwards and vertical text</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'F1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">alignment</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">textRotation</span>: <span class="pl-c1">30</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'G1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">alignment</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">textRotation</span>: <span class="pl-c1">-</span><span class="pl-c1">45</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'H1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">alignment</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">textRotation</span>: <span class="pl-s">'vertical'</span> <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div> <p><strong>Valid Alignment Property Values</strong></p> <table> <thead> <tr> <th>horizontal</th> <th>vertical</th> <th>wrapText</th> <th>shrinkToFit</th> <th>indent</th> <th>readingOrder</th> <th>textRotation</th> </tr> </thead> <tbody> <tr> <td>left</td> <td>top</td> <td>true</td> <td>true</td> <td>integer</td> <td>rtl</td> <td>0 to 90</td> </tr> <tr> <td>center</td> <td>middle</td> <td>false</td> <td>false</td> <td></td> <td>ltr</td> <td>-1 to -90</td> </tr> <tr> <td>right</td> <td>bottom</td> <td></td> <td></td> <td></td> <td></td> <td>vertical</td> </tr> <tr> <td>fill</td> <td>distributed</td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td>justify</td> <td>justify</td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td>centerContinuous</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td>distributed</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> </tbody> </table> <div class="markdown-heading"><h3 class="heading-element">Borders<a href="#contents">⬆</a> </h3><a id="user-content-borders" class="anchor" aria-label="Permalink: Borders⬆" href="#borders"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="highlight highlight-source-js"><pre><span class="pl-c">// set single thin border around A1</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">border</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">top</span>: <span class="pl-kos">{</span><span class="pl-c1">style</span>:<span class="pl-s">'thin'</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">left</span>: <span class="pl-kos">{</span><span class="pl-c1">style</span>:<span class="pl-s">'thin'</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">bottom</span>: <span class="pl-kos">{</span><span class="pl-c1">style</span>:<span class="pl-s">'thin'</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">right</span>: <span class="pl-kos">{</span><span class="pl-c1">style</span>:<span class="pl-s">'thin'</span><span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// set double thin green border around A3</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A3'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">border</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">top</span>: <span class="pl-kos">{</span><span class="pl-c1">style</span>:<span class="pl-s">'double'</span><span class="pl-kos">,</span> <span class="pl-c1">color</span>: <span class="pl-kos">{</span><span class="pl-c1">argb</span>:<span class="pl-s">'FF00FF00'</span><span class="pl-kos">}</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">left</span>: <span class="pl-kos">{</span><span class="pl-c1">style</span>:<span class="pl-s">'double'</span><span class="pl-kos">,</span> <span class="pl-c1">color</span>: <span class="pl-kos">{</span><span class="pl-c1">argb</span>:<span class="pl-s">'FF00FF00'</span><span class="pl-kos">}</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">bottom</span>: <span class="pl-kos">{</span><span class="pl-c1">style</span>:<span class="pl-s">'double'</span><span class="pl-kos">,</span> <span class="pl-c1">color</span>: <span class="pl-kos">{</span><span class="pl-c1">argb</span>:<span class="pl-s">'FF00FF00'</span><span class="pl-kos">}</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">right</span>: <span class="pl-kos">{</span><span class="pl-c1">style</span>:<span class="pl-s">'double'</span><span class="pl-kos">,</span> <span class="pl-c1">color</span>: <span class="pl-kos">{</span><span class="pl-c1">argb</span>:<span class="pl-s">'FF00FF00'</span><span class="pl-kos">}</span><span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// set thick red cross in A5</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A5'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">border</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">diagonal</span>: <span class="pl-kos">{</span><span class="pl-c1">up</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">down</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">style</span>:<span class="pl-s">'thick'</span><span class="pl-kos">,</span> <span class="pl-c1">color</span>: <span class="pl-kos">{</span><span class="pl-c1">argb</span>:<span class="pl-s">'FFFF0000'</span><span class="pl-kos">}</span><span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div> <p><strong>Valid Border Styles</strong></p> <ul> <li>thin</li> <li>dotted</li> <li>dashDot</li> <li>hair</li> <li>dashDotDot</li> <li>slantDashDot</li> <li>mediumDashed</li> <li>mediumDashDotDot</li> <li>mediumDashDot</li> <li>medium</li> <li>double</li> <li>thick</li> </ul> <div class="markdown-heading"><h3 class="heading-element">Fills<a href="#contents">⬆</a> </h3><a id="user-content-fills" class="anchor" aria-label="Permalink: Fills⬆" href="#fills"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="highlight highlight-source-js"><pre><span class="pl-c">// fill A1 with red darkVertical stripes</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">fill</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">type</span>: <span class="pl-s">'pattern'</span><span class="pl-kos">,</span> <span class="pl-c1">pattern</span>:<span class="pl-s">'darkVertical'</span><span class="pl-kos">,</span> <span class="pl-c1">fgColor</span>:<span class="pl-kos">{</span><span class="pl-c1">argb</span>:<span class="pl-s">'FFFF0000'</span><span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// fill A2 with yellow dark trellis and blue behind</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A2'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">fill</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">type</span>: <span class="pl-s">'pattern'</span><span class="pl-kos">,</span> <span class="pl-c1">pattern</span>:<span class="pl-s">'darkTrellis'</span><span class="pl-kos">,</span> <span class="pl-c1">fgColor</span>:<span class="pl-kos">{</span><span class="pl-c1">argb</span>:<span class="pl-s">'FFFFFF00'</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">bgColor</span>:<span class="pl-kos">{</span><span class="pl-c1">argb</span>:<span class="pl-s">'FF0000FF'</span><span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// fill A3 with solid coral</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A3'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">fill</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">type</span>: <span class="pl-s">'pattern'</span><span class="pl-kos">,</span> <span class="pl-c1">pattern</span>:<span class="pl-s">'solid'</span><span class="pl-kos">,</span> <span class="pl-c1">fgColor</span>:<span class="pl-kos">{</span><span class="pl-c1">argb</span>:<span class="pl-s">'F08080'</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// fill A4 with blue-white-blue gradient from left to right</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A4'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">fill</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">type</span>: <span class="pl-s">'gradient'</span><span class="pl-kos">,</span> <span class="pl-c1">gradient</span>: <span class="pl-s">'angle'</span><span class="pl-kos">,</span> <span class="pl-c1">degree</span>: <span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-c1">stops</span>: <span class="pl-kos">[</span> <span class="pl-kos">{</span><span class="pl-c1">position</span>:<span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-c1">color</span>:<span class="pl-kos">{</span><span class="pl-c1">argb</span>:<span class="pl-s">'FF0000FF'</span><span class="pl-kos">}</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-c1">position</span>:<span class="pl-c1">0.5</span><span class="pl-kos">,</span> <span class="pl-c1">color</span>:<span class="pl-kos">{</span><span class="pl-c1">argb</span>:<span class="pl-s">'FFFFFFFF'</span><span class="pl-kos">}</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-c1">position</span>:<span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">color</span>:<span class="pl-kos">{</span><span class="pl-c1">argb</span>:<span class="pl-s">'FF0000FF'</span><span class="pl-kos">}</span><span class="pl-kos">}</span> <span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// fill A5 with red-green gradient from center</span> <span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A5'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">fill</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">type</span>: <span class="pl-s">'gradient'</span><span class="pl-kos">,</span> <span class="pl-c1">gradient</span>: <span class="pl-s">'path'</span><span class="pl-kos">,</span> <span class="pl-c1">center</span>:<span class="pl-kos">{</span><span class="pl-c1">left</span>:<span class="pl-c1">0.5</span><span class="pl-kos">,</span><span class="pl-c1">top</span>:<span class="pl-c1">0.5</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">stops</span>: <span class="pl-kos">[</span> <span class="pl-kos">{</span><span class="pl-c1">position</span>:<span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-c1">color</span>:<span class="pl-kos">{</span><span class="pl-c1">argb</span>:<span class="pl-s">'FFFF0000'</span><span class="pl-kos">}</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-c1">position</span>:<span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">color</span>:<span class="pl-kos">{</span><span class="pl-c1">argb</span>:<span class="pl-s">'FF00FF00'</span><span class="pl-kos">}</span><span class="pl-kos">}</span> <span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h4 class="heading-element">Pattern Fills<a href="#contents">⬆</a> </h4><a id="user-content-pattern-fills" class="anchor" aria-label="Permalink: Pattern Fills⬆" href="#pattern-fills"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <table> <thead> <tr> <th>Property</th> <th>Required</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>type</td> <td>Y</td> <td>Value: 'pattern'<br>Specifies this fill uses patterns</td> </tr> <tr> <td>pattern</td> <td>Y</td> <td>Specifies type of pattern (see <a href="#valid-pattern-types">Valid Pattern Types</a> below)</td> </tr> <tr> <td>fgColor</td> <td>N</td> <td>Specifies the pattern foreground color. Default is black.</td> </tr> <tr> <td>bgColor</td> <td>N</td> <td>Specifies the pattern background color. Default is white.</td> </tr> </tbody> </table> <p>Note: If you want to fill a cell using the <code>solid</code> pattern, then you don't need to specify <code>bgColor</code>. See example above for cell <code>A3</code> with a <code>solid</code> pattern and a coral <code>fgColor</code>.</p> <p><strong>Valid Pattern Types</strong></p> <ul> <li>none</li> <li>solid</li> <li>darkGray</li> <li>mediumGray</li> <li>lightGray</li> <li>gray125</li> <li>gray0625</li> <li>darkHorizontal</li> <li>darkVertical</li> <li>darkDown</li> <li>darkUp</li> <li>darkGrid</li> <li>darkTrellis</li> <li>lightHorizontal</li> <li>lightVertical</li> <li>lightDown</li> <li>lightUp</li> <li>lightGrid</li> <li>lightTrellis</li> </ul> <div class="markdown-heading"><h4 class="heading-element">Gradient Fills<a href="#contents">⬆</a> </h4><a id="user-content-gradient-fills" class="anchor" aria-label="Permalink: Gradient Fills⬆" href="#gradient-fills"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <table> <thead> <tr> <th>Property</th> <th>Required</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>type</td> <td>Y</td> <td>Value: 'gradient'<br>Specifies this fill uses gradients</td> </tr> <tr> <td>gradient</td> <td>Y</td> <td>Specifies gradient type. One of ['angle', 'path']</td> </tr> <tr> <td>degree</td> <td>angle</td> <td>For 'angle' gradient, specifies the direction of the gradient. 0 is from the left to the right. Values from 1 - 359 rotates the direction clockwise</td> </tr> <tr> <td>center</td> <td>path</td> <td>For 'path' gradient. Specifies the relative coordinates for the start of the path. 'left' and 'top' values range from 0 to 1</td> </tr> <tr> <td>stops</td> <td>Y</td> <td>Specifies the gradient colour sequence. Is an array of objects containing position and color starting with position 0 and ending with position 1. Intermediary positions may be used to specify other colours on the path.</td> </tr> </tbody> </table> <p><strong>Caveats</strong></p> <p>Using the interface above it may be possible to create gradient fill effects not possible using the XLSX editor program. For example, Excel only supports angle gradients of 0, 45, 90 and 135. Similarly the sequence of stops may also be limited by the UI with positions [0,1] or [0,0.5,1] as the only options. Take care with this fill to be sure it is supported by the target XLSX viewers.</p> <div class="markdown-heading"><h3 class="heading-element">Rich Text<a href="#contents">⬆</a> </h3><a id="user-content-rich-text" class="anchor" aria-label="Permalink: Rich Text⬆" href="#rich-text"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Individual cells now support rich text or in-cell formatting. Rich text values can control the font properties of any number of sub-strings within the text value. See <a href="https://github.com/wmakeev/exceljs/blob/HEAD/font">Fonts</a> for a complete list of details on what font properties are supported.</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-s">'richText'</span>: <span class="pl-kos">[</span> <span class="pl-kos">{</span><span class="pl-s">'font'</span>: <span class="pl-kos">{</span><span class="pl-s">'size'</span>: <span class="pl-c1">12</span><span class="pl-kos">,</span><span class="pl-s">'color'</span>: <span class="pl-kos">{</span><span class="pl-s">'theme'</span>: <span class="pl-c1">0</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s">'name'</span>: <span class="pl-s">'Calibri'</span><span class="pl-kos">,</span><span class="pl-s">'family'</span>: <span class="pl-c1">2</span><span class="pl-kos">,</span><span class="pl-s">'scheme'</span>: <span class="pl-s">'minor'</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s">'text'</span>: <span class="pl-s">'This is '</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-s">'font'</span>: <span class="pl-kos">{</span><span class="pl-s">'italic'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span><span class="pl-s">'size'</span>: <span class="pl-c1">12</span><span class="pl-kos">,</span><span class="pl-s">'color'</span>: <span class="pl-kos">{</span><span class="pl-s">'theme'</span>: <span class="pl-c1">0</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s">'name'</span>: <span class="pl-s">'Calibri'</span><span class="pl-kos">,</span><span class="pl-s">'scheme'</span>: <span class="pl-s">'minor'</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s">'text'</span>: <span class="pl-s">'a'</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-s">'font'</span>: <span class="pl-kos">{</span><span class="pl-s">'size'</span>: <span class="pl-c1">12</span><span class="pl-kos">,</span><span class="pl-s">'color'</span>: <span class="pl-kos">{</span><span class="pl-s">'theme'</span>: <span class="pl-c1">1</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s">'name'</span>: <span class="pl-s">'Calibri'</span><span class="pl-kos">,</span><span class="pl-s">'family'</span>: <span class="pl-c1">2</span><span class="pl-kos">,</span><span class="pl-s">'scheme'</span>: <span class="pl-s">'minor'</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s">'text'</span>: <span class="pl-s">' '</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-s">'font'</span>: <span class="pl-kos">{</span><span class="pl-s">'size'</span>: <span class="pl-c1">12</span><span class="pl-kos">,</span><span class="pl-s">'color'</span>: <span class="pl-kos">{</span><span class="pl-s">'argb'</span>: <span class="pl-s">'FFFF6600'</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s">'name'</span>: <span class="pl-s">'Calibri'</span><span class="pl-kos">,</span><span class="pl-s">'scheme'</span>: <span class="pl-s">'minor'</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s">'text'</span>: <span class="pl-s">'colorful'</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-s">'font'</span>: <span class="pl-kos">{</span><span class="pl-s">'size'</span>: <span class="pl-c1">12</span><span class="pl-kos">,</span><span class="pl-s">'color'</span>: <span class="pl-kos">{</span><span class="pl-s">'theme'</span>: <span class="pl-c1">1</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s">'name'</span>: <span class="pl-s">'Calibri'</span><span class="pl-kos">,</span><span class="pl-s">'family'</span>: <span class="pl-c1">2</span><span class="pl-kos">,</span><span class="pl-s">'scheme'</span>: <span class="pl-s">'minor'</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s">'text'</span>: <span class="pl-s">' text '</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-s">'font'</span>: <span class="pl-kos">{</span><span class="pl-s">'size'</span>: <span class="pl-c1">12</span><span class="pl-kos">,</span><span class="pl-s">'color'</span>: <span class="pl-kos">{</span><span class="pl-s">'argb'</span>: <span class="pl-s">'FFCCFFCC'</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s">'name'</span>: <span class="pl-s">'Calibri'</span><span class="pl-kos">,</span><span class="pl-s">'scheme'</span>: <span class="pl-s">'minor'</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s">'text'</span>: <span class="pl-s">'with'</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-s">'font'</span>: <span class="pl-kos">{</span><span class="pl-s">'size'</span>: <span class="pl-c1">12</span><span class="pl-kos">,</span><span class="pl-s">'color'</span>: <span class="pl-kos">{</span><span class="pl-s">'theme'</span>: <span class="pl-c1">1</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s">'name'</span>: <span class="pl-s">'Calibri'</span><span class="pl-kos">,</span><span class="pl-s">'family'</span>: <span class="pl-c1">2</span><span class="pl-kos">,</span><span class="pl-s">'scheme'</span>: <span class="pl-s">'minor'</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s">'text'</span>: <span class="pl-s">' in-cell '</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-s">'font'</span>: <span class="pl-kos">{</span><span class="pl-s">'bold'</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span><span class="pl-s">'size'</span>: <span class="pl-c1">12</span><span class="pl-kos">,</span><span class="pl-s">'color'</span>: <span class="pl-kos">{</span><span class="pl-s">'theme'</span>: <span class="pl-c1">1</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s">'name'</span>: <span class="pl-s">'Calibri'</span><span class="pl-kos">,</span><span class="pl-s">'family'</span>: <span class="pl-c1">2</span><span class="pl-kos">,</span><span class="pl-s">'scheme'</span>: <span class="pl-s">'minor'</span><span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-s">'text'</span>: <span class="pl-s">'format'</span><span class="pl-kos">}</span> <span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">text</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">to</span><span class="pl-kos">.</span><span class="pl-en">equal</span><span class="pl-kos">(</span><span class="pl-s">'This is a colorful text with in-cell format'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">type</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">to</span><span class="pl-kos">.</span><span class="pl-en">equal</span><span class="pl-kos">(</span><span class="pl-v">Excel</span><span class="pl-kos">.</span><span class="pl-c1">ValueType</span><span class="pl-kos">.</span><span class="pl-c1">RichText</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Cell Protection<a href="#contents">⬆</a> </h3><a id="user-content-cell-protection" class="anchor" aria-label="Permalink: Cell Protection⬆" href="#cell-protection"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Cell level protection can be modified using the protection property.</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">protection</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">locked</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c1">hidden</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div> <p><strong>Supported Protection Properties</strong></p> <table> <thead> <tr> <th>Property</th> <th>Default</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>locked</td> <td>true</td> <td>Specifies whether a cell will be locked if the sheet is protected.</td> </tr> <tr> <td>hidden</td> <td>false</td> <td>Specifies whether a cell's formula will be visible if the sheet is protected.</td> </tr> </tbody> </table> <div class="markdown-heading"><h2 class="heading-element">Conditional Formatting<a href="#contents">⬆</a> </h2><a id="user-content-conditional-formatting" class="anchor" aria-label="Permalink: Conditional Formatting⬆" href="#conditional-formatting"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Conditional formatting allows a sheet to show specific styles, icons, etc depending on cell values or any arbitrary formula.</p> <p>Conditional formatting rules are added at the sheet level and will typically cover a range of cells.</p> <p>Multiple rules can be applied to a given cell range and each rule will apply its own style.</p> <p>If multiple rules affect a given cell, the rule priority value will determine which rule wins out if competing styles collide. The rule with the lower priority value wins. If priority values are not specified for a given rule, ExcelJS will assign them in ascending order.</p> <p>Note: at present, only a subset of conditional formatting rules are supported. Specifically, only the formatting rules that do not require XML rendering inside an <extLst> element. This means that datasets and three specific icon sets (3Triangles, 3Stars, 5Boxes) are not supported.</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// add a checkerboard pattern to A1:E7 based on row + col being even or odd</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">addConditionalFormatting</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">ref</span>: <span class="pl-s">'A1:E7'</span><span class="pl-kos">,</span> <span class="pl-c1">rules</span>: <span class="pl-kos">[</span> <span class="pl-kos">{</span> <span class="pl-c1">type</span>: <span class="pl-s">'expression'</span><span class="pl-kos">,</span> <span class="pl-c1">formulae</span>: <span class="pl-kos">[</span><span class="pl-s">'MOD(ROW()+COLUMN(),2)=0'</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-c1">style</span>: <span class="pl-kos">{</span><span class="pl-c1">fill</span>: <span class="pl-kos">{</span><span class="pl-c1">type</span>: <span class="pl-s">'pattern'</span><span class="pl-kos">,</span> <span class="pl-c1">pattern</span>: <span class="pl-s">'solid'</span><span class="pl-kos">,</span> <span class="pl-c1">bgColor</span>: <span class="pl-kos">{</span><span class="pl-c1">argb</span>: <span class="pl-s">'FF00FF00'</span><span class="pl-kos">}</span><span class="pl-kos">}</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">}</span> <span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div> <p><strong>Supported Conditional Formatting Rule Types</strong></p> <table> <thead> <tr> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>expression</td> <td>Any custom function may be used to activate the rule.</td> </tr> <tr> <td>cellIs</td> <td>Compares cell value with supplied formula using specified operator</td> </tr> <tr> <td>top10</td> <td>Applies formatting to cells with values in top (or bottom) ranges</td> </tr> <tr> <td>aboveAverage</td> <td>Applies formatting to cells with values above (or below) average</td> </tr> <tr> <td>colorScale</td> <td>Applies a coloured background to cells based on where their values lie in the range</td> </tr> <tr> <td>iconSet</td> <td>Adds one of a range of icons to cells based on value</td> </tr> <tr> <td>containsText</td> <td>Applies formatting based on whether cell a specific text</td> </tr> <tr> <td>timePeriod</td> <td>Applies formatting based on whether cell datetime value lies within a specified range</td> </tr> </tbody> </table> <div class="markdown-heading"><h3 class="heading-element">Expression<a href="#contents">⬆</a> </h3><a id="user-content-expression" class="anchor" aria-label="Permalink: Expression⬆" href="#expression"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <table> <thead> <tr> <th>Field</th> <th>Optional</th> <th>Default</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>type</td> <td></td> <td></td> <td>'expression'</td> </tr> <tr> <td>priority</td> <td>Y</td> <td><auto></td> <td>determines priority ordering of styles</td> </tr> <tr> <td>formulae</td> <td></td> <td></td> <td>array of 1 formula string that returns a true/false value. To reference the cell value, use the top-left cell address</td> </tr> <tr> <td>style</td> <td></td> <td></td> <td>style structure to apply if the formula returns true</td> </tr> </tbody> </table> <div class="markdown-heading"><h3 class="heading-element">Cell Is<a href="#contents">⬆</a> </h3><a id="user-content-cell-is" class="anchor" aria-label="Permalink: Cell Is⬆" href="#cell-is"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <table> <thead> <tr> <th>Field</th> <th>Optional</th> <th>Default</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>type</td> <td></td> <td></td> <td>'cellIs'</td> </tr> <tr> <td>priority</td> <td>Y</td> <td><auto></td> <td>determines priority ordering of styles</td> </tr> <tr> <td>operator</td> <td></td> <td></td> <td>how to compare cell value with formula result</td> </tr> <tr> <td>formulae</td> <td></td> <td></td> <td>array of 1 formula string that returns the value to compare against each cell</td> </tr> <tr> <td>style</td> <td></td> <td></td> <td>style structure to apply if the comparison returns true</td> </tr> </tbody> </table> <p><strong>Cell Is Operators</strong></p> <table> <thead> <tr> <th>Operator</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>equal</td> <td>Apply format if cell value equals formula value</td> </tr> <tr> <td>greaterThan</td> <td>Apply format if cell value is greater than formula value</td> </tr> <tr> <td>lessThan</td> <td>Apply format if cell value is less than formula value</td> </tr> <tr> <td>between</td> <td>Apply format if cell value is between two formula values (inclusive)</td> </tr> </tbody> </table> <div class="markdown-heading"><h3 class="heading-element">Top 10<a href="#contents">⬆</a> </h3><a id="user-content-top-10" class="anchor" aria-label="Permalink: Top 10⬆" href="#top-10"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <table> <thead> <tr> <th>Field</th> <th>Optional</th> <th>Default</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>type</td> <td></td> <td></td> <td>'top10'</td> </tr> <tr> <td>priority</td> <td>Y</td> <td><auto></td> <td>determines priority ordering of styles</td> </tr> <tr> <td>rank</td> <td>Y</td> <td>10</td> <td>specifies how many top (or bottom) values are included in the formatting</td> </tr> <tr> <td>percent</td> <td>Y</td> <td>false</td> <td>if true, the rank field is a percentage, not an absolute</td> </tr> <tr> <td>bottom</td> <td>Y</td> <td>false</td> <td>if true, the bottom values are included instead of the top</td> </tr> <tr> <td>style</td> <td></td> <td></td> <td>style structure to apply if the comparison returns true</td> </tr> </tbody> </table> <div class="markdown-heading"><h3 class="heading-element">Above Average<a href="#contents">⬆</a> </h3><a id="user-content-above-average" class="anchor" aria-label="Permalink: Above Average⬆" href="#above-average"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <table> <thead> <tr> <th>Field</th> <th>Optional</th> <th>Default</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>type</td> <td></td> <td></td> <td>'aboveAverage'</td> </tr> <tr> <td>priority</td> <td>Y</td> <td><auto></td> <td>determines priority ordering of styles</td> </tr> <tr> <td>aboveAverage</td> <td>Y</td> <td>false</td> <td>if true, the rank field is a percentage, not an absolute</td> </tr> <tr> <td>style</td> <td></td> <td></td> <td>style structure to apply if the comparison returns true</td> </tr> </tbody> </table> <div class="markdown-heading"><h3 class="heading-element">Color Scale<a href="#contents">⬆</a> </h3><a id="user-content-color-scale" class="anchor" aria-label="Permalink: Color Scale⬆" href="#color-scale"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <table> <thead> <tr> <th>Field</th> <th>Optional</th> <th>Default</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>type</td> <td></td> <td></td> <td>'colorScale'</td> </tr> <tr> <td>priority</td> <td>Y</td> <td><auto></td> <td>determines priority ordering of styles</td> </tr> <tr> <td>cfvo</td> <td></td> <td></td> <td>array of 2 to 5 Conditional Formatting Value Objects specifying way-points in the value range</td> </tr> <tr> <td>color</td> <td></td> <td></td> <td>corresponding array of colours to use at given way points</td> </tr> <tr> <td>style</td> <td></td> <td></td> <td>style structure to apply if the comparison returns true</td> </tr> </tbody> </table> <div class="markdown-heading"><h3 class="heading-element">Icon Set<a href="#contents">⬆</a> </h3><a id="user-content-icon-set" class="anchor" aria-label="Permalink: Icon Set⬆" href="#icon-set"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <table> <thead> <tr> <th>Field</th> <th>Optional</th> <th>Default</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>type</td> <td></td> <td></td> <td>'iconSet'</td> </tr> <tr> <td>priority</td> <td>Y</td> <td><auto></td> <td>determines priority ordering of styles</td> </tr> <tr> <td>iconSet</td> <td>Y</td> <td>3TrafficLights</td> <td>name of icon set to use</td> </tr> <tr> <td>showValue</td> <td></td> <td>true</td> <td>Specifies whether the cells in the applied range display the icon and cell value, or the icon only</td> </tr> <tr> <td>reverse</td> <td></td> <td>false</td> <td>Specifies whether the icons in the icon set specified in iconSet are show in reserve order. If custom equals "true" this value must be ignored</td> </tr> <tr> <td>custom</td> <td></td> <td>false</td> <td>Specifies whether a custom set of icons is used</td> </tr> <tr> <td>cfvo</td> <td></td> <td></td> <td>array of 2 to 5 Conditional Formatting Value Objects specifying way-points in the value range</td> </tr> <tr> <td>style</td> <td></td> <td></td> <td>style structure to apply if the comparison returns true</td> </tr> </tbody> </table> <div class="markdown-heading"><h3 class="heading-element">Data Bar<a href="#contents">⬆</a> </h3><a id="user-content-data-bar" class="anchor" aria-label="Permalink: Data Bar⬆" href="#data-bar"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <table> <thead> <tr> <th>Field</th> <th>Optional</th> <th>Default</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>type</td> <td></td> <td></td> <td>'dataBar'</td> </tr> <tr> <td>priority</td> <td>Y</td> <td><auto></td> <td>determines priority ordering of styles</td> </tr> <tr> <td>minLength</td> <td></td> <td>0</td> <td>Specifies the length of the shortest data bar in this conditional formatting range</td> </tr> <tr> <td>maxLength</td> <td></td> <td>100</td> <td>Specifies the length of the longest data bar in this conditional formatting range</td> </tr> <tr> <td>showValue</td> <td></td> <td>true</td> <td>Specifies whether the cells in the conditional formatting range display both the data bar and the numeric value or the data bar</td> </tr> <tr> <td>gradient</td> <td></td> <td>true</td> <td>Specifies whether the data bar has a gradient fill</td> </tr> <tr> <td>border</td> <td></td> <td>true</td> <td>Specifies whether the data bar has a border</td> </tr> <tr> <td>negativeBarColorSameAsPositive</td> <td></td> <td>true</td> <td>Specifies whether the data bar has a negative bar color that is different from the positive bar color</td> </tr> <tr> <td>negativeBarBorderColorSameAsPositive</td> <td></td> <td>true</td> <td>Specifies whether the data bar has a negative border color that is different from the positive border color</td> </tr> <tr> <td>axisPosition</td> <td></td> <td>'auto'</td> <td>Specifies the axis position for the data bar</td> </tr> <tr> <td>direction</td> <td></td> <td>'leftToRight'</td> <td>Specifies the direction of the data bar</td> </tr> <tr> <td>cfvo</td> <td></td> <td></td> <td>array of 2 to 5 Conditional Formatting Value Objects specifying way-points in the value range</td> </tr> <tr> <td>style</td> <td></td> <td></td> <td>style structure to apply if the comparison returns true</td> </tr> </tbody> </table> <div class="markdown-heading"><h3 class="heading-element">Contains Text<a href="#contents">⬆</a> </h3><a id="user-content-contains-text" class="anchor" aria-label="Permalink: Contains Text⬆" href="#contains-text"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <table> <thead> <tr> <th>Field</th> <th>Optional</th> <th>Default</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>type</td> <td></td> <td></td> <td>'containsText'</td> </tr> <tr> <td>priority</td> <td>Y</td> <td><auto></td> <td>determines priority ordering of styles</td> </tr> <tr> <td>operator</td> <td></td> <td></td> <td>type of text comparison</td> </tr> <tr> <td>text</td> <td></td> <td></td> <td>text to search for</td> </tr> <tr> <td>style</td> <td></td> <td></td> <td>style structure to apply if the comparison returns true</td> </tr> </tbody> </table> <p><strong>Contains Text Operators</strong></p> <table> <thead> <tr> <th>Operator</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>containsText</td> <td>Apply format if cell value contains the value specified in the 'text' field</td> </tr> <tr> <td>containsBlanks</td> <td>Apply format if cell value contains blanks</td> </tr> <tr> <td>notContainsBlanks</td> <td>Apply format if cell value does not contain blanks</td> </tr> <tr> <td>containsErrors</td> <td>Apply format if cell value contains errors</td> </tr> <tr> <td>notContainsErrors</td> <td>Apply format if cell value does not contain errors</td> </tr> </tbody> </table> <div class="markdown-heading"><h3 class="heading-element">Time Period<a href="#contents">⬆</a> </h3><a id="user-content-time-period" class="anchor" aria-label="Permalink: Time Period⬆" href="#time-period"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <table> <thead> <tr> <th>Field</th> <th>Optional</th> <th>Default</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>type</td> <td></td> <td></td> <td>'timePeriod'</td> </tr> <tr> <td>priority</td> <td>Y</td> <td><auto></td> <td>determines priority ordering of styles</td> </tr> <tr> <td>timePeriod</td> <td></td> <td></td> <td>what time period to compare cell value to</td> </tr> <tr> <td>style</td> <td></td> <td></td> <td>style structure to apply if the comparison returns true</td> </tr> </tbody> </table> <p><strong>Time Periods</strong></p> <table> <thead> <tr> <th>Time Period</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>lastWeek</td> <td>Apply format if cell value falls within the last week</td> </tr> <tr> <td>thisWeek</td> <td>Apply format if cell value falls in this week</td> </tr> <tr> <td>nextWeek</td> <td>Apply format if cell value falls in the next week</td> </tr> <tr> <td>yesterday</td> <td>Apply format if cell value is equal to yesterday</td> </tr> <tr> <td>today</td> <td>Apply format if cell value is equal to today</td> </tr> <tr> <td>tomorrow</td> <td>Apply format if cell value is equal to tomorrow</td> </tr> <tr> <td>last7Days</td> <td>Apply format if cell value falls within the last 7 days</td> </tr> <tr> <td>lastMonth</td> <td>Apply format if cell value falls in last month</td> </tr> <tr> <td>thisMonth</td> <td>Apply format if cell value falls in this month</td> </tr> <tr> <td>nextMonth</td> <td>Apply format if cell value falls in next month</td> </tr> </tbody> </table> <div class="markdown-heading"><h2 class="heading-element">Outline Levels<a href="#contents">⬆</a> </h2><a id="user-content-outline-levels" class="anchor" aria-label="Permalink: Outline Levels⬆" href="#outline-levels"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Excel supports outlining; where rows or columns can be expanded or collapsed depending on what level of detail the user wishes to view.</p> <p>Outline levels can be defined in column setup:</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">columns</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span> <span class="pl-kos">{</span> <span class="pl-c1">header</span>: <span class="pl-s">'Id'</span><span class="pl-kos">,</span> <span class="pl-c1">key</span>: <span class="pl-s">'id'</span><span class="pl-kos">,</span> <span class="pl-c1">width</span>: <span class="pl-c1">10</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">header</span>: <span class="pl-s">'Name'</span><span class="pl-kos">,</span> <span class="pl-c1">key</span>: <span class="pl-s">'name'</span><span class="pl-kos">,</span> <span class="pl-c1">width</span>: <span class="pl-c1">32</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">header</span>: <span class="pl-s">'D.O.B.'</span><span class="pl-kos">,</span> <span class="pl-c1">key</span>: <span class="pl-s">'DOB'</span><span class="pl-kos">,</span> <span class="pl-c1">width</span>: <span class="pl-c1">10</span><span class="pl-kos">,</span> <span class="pl-c1">outlineLevel</span>: <span class="pl-c1">1</span> <span class="pl-kos">}</span> <span class="pl-kos">]</span><span class="pl-kos">;</span></pre></div> <p>Or directly on the row or column</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getColumn</span><span class="pl-kos">(</span><span class="pl-c1">3</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">outlineLevel</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getRow</span><span class="pl-kos">(</span><span class="pl-c1">3</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">outlineLevel</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span></pre></div> <p>The sheet outline levels can be set on the worksheet</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// set column outline level</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">properties</span><span class="pl-kos">.</span><span class="pl-c1">outlineLevelCol</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-c">// set row outline level</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">properties</span><span class="pl-kos">.</span><span class="pl-c1">outlineLevelRow</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span></pre></div> <p>Note: adjusting outline levels on rows or columns or the outline levels on the worksheet will incur a side effect of also modifying the collapsed property of all rows or columns affected by the property change. E.g.:</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">properties</span><span class="pl-kos">.</span><span class="pl-c1">outlineLevelCol</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getColumn</span><span class="pl-kos">(</span><span class="pl-c1">3</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">outlineLevel</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getColumn</span><span class="pl-kos">(</span><span class="pl-c1">3</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">collapsed</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">to</span><span class="pl-kos">.</span><span class="pl-c1">be</span><span class="pl-kos">.</span><span class="pl-c1">true</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">properties</span><span class="pl-kos">.</span><span class="pl-c1">outlineLevelCol</span> <span class="pl-c1">=</span> <span class="pl-c1">2</span><span class="pl-kos">;</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getColumn</span><span class="pl-kos">(</span><span class="pl-c1">3</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">collapsed</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">to</span><span class="pl-kos">.</span><span class="pl-c1">be</span><span class="pl-kos">.</span><span class="pl-c1">false</span><span class="pl-kos">;</span></pre></div> <p>The outline properties can be set on the worksheet</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-c1">properties</span><span class="pl-kos">.</span><span class="pl-c1">outlineProperties</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">summaryBelow</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c1">summaryRight</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Images<a href="#contents">⬆</a> </h2><a id="user-content-images" class="anchor" aria-label="Permalink: Images⬆" href="#images"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Adding images to a worksheet is a two-step process. First, the image is added to the workbook via the addImage() function which will also return an imageId value. Then, using the imageId, the image can be added to the worksheet either as a tiled background or covering a cell range.</p> <p>Note: As of this version, adjusting or transforming the image is not supported and images are not supported in streaming mode.</p> <div class="markdown-heading"><h3 class="heading-element">Add Image to Workbook<a href="#contents">⬆</a> </h3><a id="user-content-add-image-to-workbook" class="anchor" aria-label="Permalink: Add Image to Workbook⬆" href="#add-image-to-workbook"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>The Workbook.addImage function supports adding images by filename or by Buffer. Note that in both cases, the extension must be specified. Valid extension values include 'jpeg', 'png', 'gif'.</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// add image to workbook by filename</span> <span class="pl-k">const</span> <span class="pl-s1">imageId1</span> <span class="pl-c1">=</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-en">addImage</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">filename</span>: <span class="pl-s">'path/to/image.jpg'</span><span class="pl-kos">,</span> <span class="pl-c1">extension</span>: <span class="pl-s">'jpeg'</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// add image to workbook by buffer</span> <span class="pl-k">const</span> <span class="pl-s1">imageId2</span> <span class="pl-c1">=</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-en">addImage</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">buffer</span>: <span class="pl-s1">fs</span><span class="pl-kos">.</span><span class="pl-en">readFileSync</span><span class="pl-kos">(</span><span class="pl-s">'path/to.image.png'</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-c1">extension</span>: <span class="pl-s">'png'</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// add image to workbook by base64</span> <span class="pl-k">const</span> <span class="pl-s1">myBase64Image</span> <span class="pl-c1">=</span> <span class="pl-s">"data:image/png;base64,iVBORw0KG..."</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">imageId2</span> <span class="pl-c1">=</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-en">addImage</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">base64</span>: <span class="pl-s1">myBase64Image</span><span class="pl-kos">,</span> <span class="pl-c1">extension</span>: <span class="pl-s">'png'</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Add image background to worksheet<a href="#contents">⬆</a> </h3><a id="user-content-add-image-background-to-worksheet" class="anchor" aria-label="Permalink: Add image background to worksheet⬆" href="#add-image-background-to-worksheet"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Using the image id from Workbook.addImage, the background to a worksheet can be set using the addBackgroundImage function</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// set background</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">addBackgroundImage</span><span class="pl-kos">(</span><span class="pl-s1">imageId1</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Add image over a range<a href="#contents">⬆</a> </h3><a id="user-content-add-image-over-a-range" class="anchor" aria-label="Permalink: Add image over a range⬆" href="#add-image-over-a-range"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Using the image id from Workbook.addImage, an image can be embedded within the worksheet to cover a range. The coordinates calculated from the range will cover from the top-left of the first cell to the bottom right of the second.</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// insert an image over B2:D6</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">addImage</span><span class="pl-kos">(</span><span class="pl-s1">imageId2</span><span class="pl-kos">,</span> <span class="pl-s">'B2:D6'</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p>Using a structure instead of a range string, it is possible to partially cover cells.</p> <p>Note that the coordinate system used for this is zero based, so the top-left of A1 will be { col: 0, row: 0 }. Fractions of cells can be specified by using floating point numbers, e.g. the midpoint of A1 is { col: 0.5, row: 0.5 }.</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// insert an image over part of B2:D6</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">addImage</span><span class="pl-kos">(</span><span class="pl-s1">imageId2</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">tl</span>: <span class="pl-kos">{</span> <span class="pl-c1">col</span>: <span class="pl-c1">1.5</span><span class="pl-kos">,</span> <span class="pl-c1">row</span>: <span class="pl-c1">1.5</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">br</span>: <span class="pl-kos">{</span> <span class="pl-c1">col</span>: <span class="pl-c1">3.5</span><span class="pl-kos">,</span> <span class="pl-c1">row</span>: <span class="pl-c1">5.5</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p>The cell range can also have the property 'editAs' which will control how the image is anchored to the cell(s) It can have one of the following values:</p> <table> <thead> <tr> <th>Value</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>undefined</td> <td>It specifies the image will be moved and sized with cells</td> </tr> <tr> <td>oneCell</td> <td>This is the default. Image will be moved with cells but not sized</td> </tr> <tr> <td>absolute</td> <td>Image will not be moved or sized with cells</td> </tr> </tbody> </table> <div class="highlight highlight-source-js"><pre><span class="pl-s1">ws</span><span class="pl-kos">.</span><span class="pl-en">addImage</span><span class="pl-kos">(</span><span class="pl-s1">imageId</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">tl</span>: <span class="pl-kos">{</span> <span class="pl-c1">col</span>: <span class="pl-c1">0.1125</span><span class="pl-kos">,</span> <span class="pl-c1">row</span>: <span class="pl-c1">0.4</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">br</span>: <span class="pl-kos">{</span> <span class="pl-c1">col</span>: <span class="pl-c1">2.101046875</span><span class="pl-kos">,</span> <span class="pl-c1">row</span>: <span class="pl-c1">3.4</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">editAs</span>: <span class="pl-s">'oneCell'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Add image to a cell<a href="#contents">⬆</a> </h3><a id="user-content-add-image-to-a-cell" class="anchor" aria-label="Permalink: Add image to a cell⬆" href="#add-image-to-a-cell"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>You can add an image to a cell and then define its width and height in pixels at 96dpi.</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">addImage</span><span class="pl-kos">(</span><span class="pl-s1">imageId2</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">tl</span>: <span class="pl-kos">{</span> <span class="pl-c1">col</span>: <span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-c1">row</span>: <span class="pl-c1">0</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">ext</span>: <span class="pl-kos">{</span> <span class="pl-c1">width</span>: <span class="pl-c1">500</span><span class="pl-kos">,</span> <span class="pl-c1">height</span>: <span class="pl-c1">200</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Add image with hyperlinks<a href="#contents">⬆</a> </h3><a id="user-content-add-image-with-hyperlinks" class="anchor" aria-label="Permalink: Add image with hyperlinks⬆" href="#add-image-with-hyperlinks"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>You can add an image with hyperlinks to a cell, and defines the hyperlinks in image range.</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">addImage</span><span class="pl-kos">(</span><span class="pl-s1">imageId2</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">tl</span>: <span class="pl-kos">{</span> <span class="pl-c1">col</span>: <span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-c1">row</span>: <span class="pl-c1">0</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">ext</span>: <span class="pl-kos">{</span> <span class="pl-c1">width</span>: <span class="pl-c1">500</span><span class="pl-kos">,</span> <span class="pl-c1">height</span>: <span class="pl-c1">200</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">hyperlinks</span>: <span class="pl-kos">{</span> <span class="pl-c1">hyperlink</span>: <span class="pl-s">'http://www.somewhere.com'</span><span class="pl-kos">,</span> <span class="pl-c1">tooltip</span>: <span class="pl-s">'http://www.somewhere.com'</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Sheet Protection<a href="#contents">⬆</a> </h2><a id="user-content-sheet-protection" class="anchor" aria-label="Permalink: Sheet Protection⬆" href="#sheet-protection"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Worksheets can be protected from modification by adding a password.</p> <div class="highlight highlight-source-js"><pre><span class="pl-k">await</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">protect</span><span class="pl-kos">(</span><span class="pl-s">'the-password'</span><span class="pl-kos">,</span> <span class="pl-s1">options</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p>Worksheet protection can also be removed:</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">unprotect</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p>See <a href="#cell-protection">Cell Protection</a> for details on how to modify individual cell protection.</p> <p><strong>Note:</strong> While the protect() function returns a Promise indicating that it is async, the current implementation runs on the main thread and will use approx 600ms on an average CPU. This can be adjusted by setting the spinCount, which can be used to make the process either faster or more resilient.</p> <div class="markdown-heading"><h3 class="heading-element">Sheet Protection Options<a href="#contents">⬆</a> </h3><a id="user-content-sheet-protection-options" class="anchor" aria-label="Permalink: Sheet Protection Options⬆" href="#sheet-protection-options"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <table> <thead> <tr> <th>Field</th> <th>Default</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>selectLockedCells</td> <td>true</td> <td>Lets the user select locked cells</td> </tr> <tr> <td>selectUnlockedCells</td> <td>true</td> <td>Lets the user select unlocked cells</td> </tr> <tr> <td>formatCells</td> <td>false</td> <td>Lets the user format cells</td> </tr> <tr> <td>formatColumns</td> <td>false</td> <td>Lets the user format columns</td> </tr> <tr> <td>formatRows</td> <td>false</td> <td>Lets the user format rows</td> </tr> <tr> <td>insertRows</td> <td>false</td> <td>Lets the user insert rows</td> </tr> <tr> <td>insertColumns</td> <td>false</td> <td>Lets the user insert columns</td> </tr> <tr> <td>insertHyperlinks</td> <td>false</td> <td>Lets the user insert hyperlinks</td> </tr> <tr> <td>deleteRows</td> <td>false</td> <td>Lets the user delete rows</td> </tr> <tr> <td>deleteColumns</td> <td>false</td> <td>Lets the user delete columns</td> </tr> <tr> <td>sort</td> <td>false</td> <td>Lets the user sort data</td> </tr> <tr> <td>autoFilter</td> <td>false</td> <td>Lets the user filter data in tables</td> </tr> <tr> <td>pivotTables</td> <td>false</td> <td>Lets the user use pivot tables</td> </tr> <tr> <td>spinCount</td> <td>100000</td> <td>The number of hash iterations performed when protecting or unprotecting</td> </tr> </tbody> </table> <div class="markdown-heading"><h2 class="heading-element">File I/O<a href="#contents">⬆</a> </h2><a id="user-content-file-io" class="anchor" aria-label="Permalink: File I/O⬆" href="#file-io"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="markdown-heading"><h3 class="heading-element">XLSX<a href="#contents">⬆</a> </h3><a id="user-content-xlsx" class="anchor" aria-label="Permalink: XLSX⬆" href="#xlsx"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="markdown-heading"><h4 class="heading-element">Reading XLSX<a href="#contents">⬆</a> </h4><a id="user-content-reading-xlsx" class="anchor" aria-label="Permalink: Reading XLSX⬆" href="#reading-xlsx"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Options supported when reading XLSX files.</p> <table> <thead> <tr> <th>Field</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>ignoreNodes</td> <td>N</td> <td>Array</td> <td>A list of node names to ignore while loading the XLSX document. Improves performance in some situations. <br> Available: <code>sheetPr</code>, <code>dimension</code>, <code>sheetViews </code>, <code>sheetFormatPr</code>, <code>cols </code>, <code>sheetData</code>, <code>autoFilter </code>, <code>mergeCells </code>, <code>rowBreaks</code>, <code>hyperlinks </code>, <code>pageMargins</code>, <code>dataValidations</code>, <code>pageSetup</code>, <code>headerFooter </code>, <code>printOptions </code>, <code>picture</code>, <code>drawing</code>, <code>sheetProtection</code>, <code>tableParts </code>, <code>conditionalFormatting</code>, <code>extLst</code>,</td> </tr> </tbody> </table> <div class="highlight highlight-source-js"><pre><span class="pl-c">// read from a file</span> <span class="pl-k">const</span> <span class="pl-s1">workbook</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Excel</span><span class="pl-kos">.</span><span class="pl-c1">Workbook</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">await</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">xlsx</span><span class="pl-kos">.</span><span class="pl-en">readFile</span><span class="pl-kos">(</span><span class="pl-s1">filename</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// ... use workbook</span> <span class="pl-c">// read from a stream</span> <span class="pl-k">const</span> <span class="pl-s1">workbook</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Excel</span><span class="pl-kos">.</span><span class="pl-c1">Workbook</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">await</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">xlsx</span><span class="pl-kos">.</span><span class="pl-en">read</span><span class="pl-kos">(</span><span class="pl-s1">stream</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// ... use workbook</span> <span class="pl-c">// load from buffer</span> <span class="pl-k">const</span> <span class="pl-s1">workbook</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Excel</span><span class="pl-kos">.</span><span class="pl-c1">Workbook</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">await</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">xlsx</span><span class="pl-kos">.</span><span class="pl-en">load</span><span class="pl-kos">(</span><span class="pl-s1">data</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// ... use workbook</span> <span class="pl-c">// using additional options</span> <span class="pl-k">const</span> <span class="pl-s1">workbook</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Excel</span><span class="pl-kos">.</span><span class="pl-c1">Workbook</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">await</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">xlsx</span><span class="pl-kos">.</span><span class="pl-en">load</span><span class="pl-kos">(</span><span class="pl-s1">data</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">ignoreNodes</span>: <span class="pl-kos">[</span> <span class="pl-s">'dataValidations'</span> <span class="pl-c">// ignores the workbook's Data Validations</span> <span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// ... use workbook</span></pre></div> <div class="markdown-heading"><h4 class="heading-element">Writing XLSX<a href="#contents">⬆</a> </h4><a id="user-content-writing-xlsx" class="anchor" aria-label="Permalink: Writing XLSX⬆" href="#writing-xlsx"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="highlight highlight-source-js"><pre><span class="pl-c">// write to a file</span> <span class="pl-k">const</span> <span class="pl-s1">workbook</span> <span class="pl-c1">=</span> <span class="pl-en">createAndFillWorkbook</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">await</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">xlsx</span><span class="pl-kos">.</span><span class="pl-en">writeFile</span><span class="pl-kos">(</span><span class="pl-s1">filename</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// write to a stream</span> <span class="pl-k">await</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">xlsx</span><span class="pl-kos">.</span><span class="pl-en">write</span><span class="pl-kos">(</span><span class="pl-s1">stream</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// write to a new buffer</span> <span class="pl-k">const</span> <span class="pl-s1">buffer</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">xlsx</span><span class="pl-kos">.</span><span class="pl-en">writeBuffer</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">CSV<a href="#contents">⬆</a> </h3><a id="user-content-csv" class="anchor" aria-label="Permalink: CSV⬆" href="#csv"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="markdown-heading"><h4 class="heading-element">Reading CSV<a href="#contents">⬆</a> </h4><a id="user-content-reading-csv" class="anchor" aria-label="Permalink: Reading CSV⬆" href="#reading-csv"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Options supported when reading CSV files.</p> <table> <thead> <tr> <th>Field</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>dateFormats</td> <td>N</td> <td>Array</td> <td>Specify the date encoding format of dayjs.</td> </tr> <tr> <td>map</td> <td>N</td> <td>Function</td> <td>Custom Array.prototype.map() callback function for processing data.</td> </tr> <tr> <td>sheetName</td> <td>N</td> <td>String</td> <td>Specify worksheet name.</td> </tr> <tr> <td>parserOptions</td> <td>N</td> <td>Object</td> <td> <a href="https://c2fo.github.io/fast-csv/docs/parsing/options" rel="nofollow">parseOptions options</a> @fast-csv/format module to write csv data.</td> </tr> </tbody> </table> <div class="highlight highlight-source-js"><pre><span class="pl-c">// read from a file</span> <span class="pl-k">const</span> <span class="pl-s1">workbook</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Excel</span><span class="pl-kos">.</span><span class="pl-c1">Workbook</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">worksheet</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">csv</span><span class="pl-kos">.</span><span class="pl-en">readFile</span><span class="pl-kos">(</span><span class="pl-s1">filename</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// ... use workbook or worksheet</span> <span class="pl-c">// read from a stream</span> <span class="pl-k">const</span> <span class="pl-s1">workbook</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Excel</span><span class="pl-kos">.</span><span class="pl-c1">Workbook</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">worksheet</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">csv</span><span class="pl-kos">.</span><span class="pl-en">read</span><span class="pl-kos">(</span><span class="pl-s1">stream</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// ... use workbook or worksheet</span> <span class="pl-c">// read from a file with European Dates</span> <span class="pl-k">const</span> <span class="pl-s1">workbook</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Excel</span><span class="pl-kos">.</span><span class="pl-c1">Workbook</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">options</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">dateFormats</span>: <span class="pl-kos">[</span><span class="pl-s">'DD/MM/YYYY'</span><span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">worksheet</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">csv</span><span class="pl-kos">.</span><span class="pl-en">readFile</span><span class="pl-kos">(</span><span class="pl-s1">filename</span><span class="pl-kos">,</span> <span class="pl-s1">options</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// ... use workbook or worksheet</span> <span class="pl-c">// read from a file with custom value parsing</span> <span class="pl-k">const</span> <span class="pl-s1">workbook</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Excel</span><span class="pl-kos">.</span><span class="pl-c1">Workbook</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">options</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-en">map</span><span class="pl-kos">(</span><span class="pl-s1">value</span><span class="pl-kos">,</span> <span class="pl-s1">index</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">switch</span><span class="pl-kos">(</span><span class="pl-s1">index</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">case</span> <span class="pl-c1">0</span>: <span class="pl-c">// column 1 is string</span> <span class="pl-k">return</span> <span class="pl-s1">value</span><span class="pl-kos">;</span> <span class="pl-k">case</span> <span class="pl-c1">1</span>: <span class="pl-c">// column 2 is a date</span> <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-s1">value</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">case</span> <span class="pl-c1">2</span>: <span class="pl-c">// column 3 is JSON of a formula value</span> <span class="pl-k">return</span> <span class="pl-c1">JSON</span><span class="pl-kos">.</span><span class="pl-en">parse</span><span class="pl-kos">(</span><span class="pl-s1">value</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">default</span>: <span class="pl-c">// the rest are numbers</span> <span class="pl-k">return</span> <span class="pl-en">parseFloat</span><span class="pl-kos">(</span><span class="pl-s1">value</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// https://c2fo.github.io/fast-csv/docs/parsing/options</span> <span class="pl-c1">parserOptions</span>: <span class="pl-kos">{</span> <span class="pl-c1">delimiter</span>: <span class="pl-s">'\t'</span><span class="pl-kos">,</span> <span class="pl-c1">quote</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">worksheet</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">csv</span><span class="pl-kos">.</span><span class="pl-en">readFile</span><span class="pl-kos">(</span><span class="pl-s1">filename</span><span class="pl-kos">,</span> <span class="pl-s1">options</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// ... use workbook or worksheet</span></pre></div> <p>The CSV parser uses <a href="https://www.npmjs.com/package/fast-csv" rel="nofollow">fast-csv</a> to read the CSV file. The formatterOptions in the options passed to the above write function will be passed to the @fast-csv/format module to write csv data. Please refer to the fast-csv README.md for details.</p> <p>Dates are parsed using the npm module <a href="https://www.npmjs.com/package/dayjs" rel="nofollow">dayjs</a>. If a dateFormats array is not supplied, the following dateFormats are used:</p> <ul> <li>'YYYY-MM-DD[T]HH:mm:ss'</li> <li>'MM-DD-YYYY'</li> <li>'YYYY-MM-DD'</li> </ul> <p>Please refer to the <a href="https://github.com/iamkun/dayjs/blob/HEAD/docs/en/Plugin.md#customparseformat">dayjs CustomParseFormat plugin</a> for details on how to structure a dateFormat.</p> <div class="markdown-heading"><h4 class="heading-element">Writing CSV<a href="#contents">⬆</a> </h4><a id="user-content-writing-csv" class="anchor" aria-label="Permalink: Writing CSV⬆" href="#writing-csv"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Options supported when writing to a CSV file.</p> <table> <thead> <tr> <th>Field</th> <th>Required</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>dateFormat</td> <td>N</td> <td>String</td> <td>Specify the date encoding format of dayjs.</td> </tr> <tr> <td>dateUTC</td> <td>N</td> <td>Boolean</td> <td>Specify whether ExcelJS uses <code>dayjs.utc ()</code> to convert time zone for parsing dates.</td> </tr> <tr> <td>encoding</td> <td>N</td> <td>String</td> <td>Specify file encoding format. (Only applies to <code>.writeFile</code>.)</td> </tr> <tr> <td>includeEmptyRows</td> <td>N</td> <td>Boolean</td> <td>Specifies whether empty rows can be written.</td> </tr> <tr> <td>map</td> <td>N</td> <td>Function</td> <td>Custom Array.prototype.map() callback function for processing row values.</td> </tr> <tr> <td>sheetName</td> <td>N</td> <td>String</td> <td>Specify worksheet name.</td> </tr> <tr> <td>sheetId</td> <td>N</td> <td>Number</td> <td>Specify worksheet ID.</td> </tr> <tr> <td>formatterOptions</td> <td>N</td> <td>Object</td> <td> <a href="https://c2fo.github.io/fast-csv/docs/formatting/options/" rel="nofollow">formatterOptions options</a> @fast-csv/format module to write csv data.</td> </tr> </tbody> </table> <div class="highlight highlight-source-js"><pre><span class="pl-c">// write to a file</span> <span class="pl-k">const</span> <span class="pl-s1">workbook</span> <span class="pl-c1">=</span> <span class="pl-en">createAndFillWorkbook</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">await</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">csv</span><span class="pl-kos">.</span><span class="pl-en">writeFile</span><span class="pl-kos">(</span><span class="pl-s1">filename</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// write to a stream</span> <span class="pl-c">// Be careful that you need to provide sheetName or</span> <span class="pl-c">// sheetId for correct import to csv.</span> <span class="pl-k">await</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">csv</span><span class="pl-kos">.</span><span class="pl-en">write</span><span class="pl-kos">(</span><span class="pl-s1">stream</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">sheetName</span>: <span class="pl-s">'Page name'</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// write to a file with European Date-Times</span> <span class="pl-k">const</span> <span class="pl-s1">workbook</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Excel</span><span class="pl-kos">.</span><span class="pl-c1">Workbook</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">options</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">dateFormat</span>: <span class="pl-s">'DD/MM/YYYY HH:mm:ss'</span><span class="pl-kos">,</span> <span class="pl-c1">dateUTC</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c">// use utc when rendering dates</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-k">await</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">csv</span><span class="pl-kos">.</span><span class="pl-en">writeFile</span><span class="pl-kos">(</span><span class="pl-s1">filename</span><span class="pl-kos">,</span> <span class="pl-s1">options</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// write to a file with custom value formatting</span> <span class="pl-k">const</span> <span class="pl-s1">workbook</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Excel</span><span class="pl-kos">.</span><span class="pl-c1">Workbook</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">options</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-en">map</span><span class="pl-kos">(</span><span class="pl-s1">value</span><span class="pl-kos">,</span> <span class="pl-s1">index</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">switch</span><span class="pl-kos">(</span><span class="pl-s1">index</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">case</span> <span class="pl-c1">0</span>: <span class="pl-c">// column 1 is string</span> <span class="pl-k">return</span> <span class="pl-s1">value</span><span class="pl-kos">;</span> <span class="pl-k">case</span> <span class="pl-c1">1</span>: <span class="pl-c">// column 2 is a date</span> <span class="pl-k">return</span> <span class="pl-en">dayjs</span><span class="pl-kos">(</span><span class="pl-s1">value</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">format</span><span class="pl-kos">(</span><span class="pl-s">'YYYY-MM-DD'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">case</span> <span class="pl-c1">2</span>: <span class="pl-c">// column 3 is a formula, write just the result</span> <span class="pl-k">return</span> <span class="pl-s1">value</span><span class="pl-kos">.</span><span class="pl-c1">result</span><span class="pl-kos">;</span> <span class="pl-k">default</span>: <span class="pl-c">// the rest are numbers</span> <span class="pl-k">return</span> <span class="pl-s1">value</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c">// https://c2fo.github.io/fast-csv/docs/formatting/options</span> <span class="pl-c1">formatterOptions</span>: <span class="pl-kos">{</span> <span class="pl-c1">delimiter</span>: <span class="pl-s">'\t'</span><span class="pl-kos">,</span> <span class="pl-c1">quote</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-k">await</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">csv</span><span class="pl-kos">.</span><span class="pl-en">writeFile</span><span class="pl-kos">(</span><span class="pl-s1">filename</span><span class="pl-kos">,</span> <span class="pl-s1">options</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// write to a new buffer</span> <span class="pl-k">const</span> <span class="pl-s1">buffer</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-c1">csv</span><span class="pl-kos">.</span><span class="pl-en">writeBuffer</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p>The CSV parser uses <a href="https://www.npmjs.com/package/fast-csv" rel="nofollow">fast-csv</a> to write the CSV file. The formatterOptions in the options passed to the above write function will be passed to the @fast-csv/format module to write csv data. Please refer to the fast-csv README.md for details.</p> <p>Dates are formatted using the npm module <a href="https://www.npmjs.com/package/dayjs" rel="nofollow">dayjs</a>. If no dateFormat is supplied, dayjs.ISO_8601 is used. When writing a CSV you can supply the boolean dateUTC as true to have ExcelJS parse the date without automatically converting the timezone using <code>dayjs.utc()</code>.</p> <div class="markdown-heading"><h3 class="heading-element">Streaming I/O<a href="#contents">⬆</a> </h3><a id="user-content-streaming-io" class="anchor" aria-label="Permalink: Streaming I/O⬆" href="#streaming-io"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>The File I/O documented above requires that an entire workbook is built up in memory before the file can be written. While convenient, it can limit the size of the document due to the amount of memory required.</p> <p>A streaming writer (or reader) processes the workbook or worksheet data as it is generated, converting it into file form as it goes. Typically this is much more efficient on memory as the final memory footprint and even intermediate memory footprints are much more compact than with the document version, especially when you consider that the row and cell objects are disposed once they are committed.</p> <p>The interface to the streaming workbook and worksheet is almost the same as the document versions with a few minor practical differences:</p> <ul> <li>Once a worksheet is added to a workbook, it cannot be removed.</li> <li>Once a row is committed, it is no longer accessible since it will have been dropped from the worksheet.</li> <li>unMergeCells() is not supported.</li> </ul> <p>Note that it is possible to build the entire workbook without committing any rows. When the workbook is committed, all added worksheets (including all uncommitted rows) will be automatically committed. However in this case, little will have been gained over the Document version.</p> <div class="markdown-heading"><h4 class="heading-element">Streaming XLSX<a href="#contents">⬆</a> </h4><a id="user-content-streaming-xlsx" class="anchor" aria-label="Permalink: Streaming XLSX⬆" href="#streaming-xlsx"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="markdown-heading"><h5 class="heading-element">Streaming XLSX Writer(#contents) </h5><a id="user-content-streaming-xlsx-writercontents" class="anchor" aria-label="Permalink: Streaming XLSX Writer(#contents)" href="#streaming-xlsx-writercontents"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>The streaming XLSX workbook writer is available in the ExcelJS.stream.xlsx namespace.</p> <p>The constructor takes an optional options object with the following fields:</p> <table> <thead> <tr> <th>Field</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>stream</td> <td>Specifies a writable stream to write the XLSX workbook to.</td> </tr> <tr> <td>filename</td> <td>If stream not specified, this field specifies the path to a file to write the XLSX workbook to.</td> </tr> <tr> <td>useSharedStrings</td> <td>Specifies whether to use shared strings in the workbook. Default is <code>false</code>.</td> </tr> <tr> <td>useStyles</td> <td>Specifies whether to add style information to the workbook. Styles can add some performance overhead. Default is <code>false</code>.</td> </tr> <tr> <td>zip</td> <td> <a href="https://www.archiverjs.com/global.html#ZipOptions" rel="nofollow">Zip options</a> that ExcelJS internally passes to <a href="https://github.com/archiverjs/node-archiver">Archiver</a>. Default is <code>undefined</code>.</td> </tr> </tbody> </table> <p>If neither stream nor filename is specified in the options, the workbook writer will create a StreamBuf object that will store the contents of the XLSX workbook in memory. This StreamBuf object, which can be accessed via the property workbook.stream, can be used to either access the bytes directly by stream.read() or to pipe the contents to another stream.</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// construct a streaming XLSX workbook writer with styles and shared strings</span> <span class="pl-k">const</span> <span class="pl-s1">options</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">filename</span>: <span class="pl-s">'./streamed-workbook.xlsx'</span><span class="pl-kos">,</span> <span class="pl-c1">useStyles</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">useSharedStrings</span>: <span class="pl-c1">true</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">workbook</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Excel</span><span class="pl-kos">.</span><span class="pl-c1">stream</span><span class="pl-kos">.</span><span class="pl-c1">xlsx</span><span class="pl-kos">.</span><span class="pl-c1">WorkbookWriter</span><span class="pl-kos">(</span><span class="pl-s1">options</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p>In general, the interface to the streaming XLSX writer is the same as the Document workbook (and worksheets) described above, in fact the row, cell and style objects are the same.</p> <p>However there are some differences...</p> <p><strong>Construction</strong></p> <p>As seen above, the WorkbookWriter will typically require the output stream or file to be specified in the constructor.</p> <p><strong>Committing Data</strong></p> <p>When a worksheet row is ready, it should be committed so that the row object and contents can be freed. Typically this would be done as each row is added...</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">addRow</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">id</span>: <span class="pl-s1">i</span><span class="pl-kos">,</span> <span class="pl-c1">name</span>: <span class="pl-s1">theName</span><span class="pl-kos">,</span> <span class="pl-c1">etc</span>: <span class="pl-s1">someOtherDetail</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">commit</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p>The reason the WorksheetWriter does not commit rows as they are added is to allow cells to be merged across rows:</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">mergeCells</span><span class="pl-kos">(</span><span class="pl-s">'A1:B2'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-s">'I am merged'</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'C1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-s">'I am not'</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'C2'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-s">'Neither am I'</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getRow</span><span class="pl-kos">(</span><span class="pl-c1">2</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">commit</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// now rows 1 and two are committed.</span></pre></div> <p>As each worksheet is completed, it must also be committed:</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// Finished adding data. Commit the worksheet</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">commit</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p>To complete the XLSX document, the workbook must be committed. If any worksheet in a workbook are uncommitted, they will be committed automatically as part of the workbook commit.</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// Finished the workbook.</span> <span class="pl-k">await</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-en">commit</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// ... the stream has been written</span></pre></div> <div class="markdown-heading"><h5 class="heading-element">Streaming XLSX Reader(#contents) </h5><a id="user-content-streaming-xlsx-readercontents" class="anchor" aria-label="Permalink: Streaming XLSX Reader(#contents)" href="#streaming-xlsx-readercontents"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>The streaming XLSX workbook reader is available in the ExcelJS.stream.xlsx namespace.</p> <p>The constructor takes a required input argument and an optional options argument:</p> <table> <thead> <tr> <th>Argument</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>input (required)</td> <td>Specifies the name of the file or the readable stream from which to read the XLSX workbook.</td> </tr> <tr> <td>options (optional)</td> <td>Specifies how to handle the event types occuring during the read parsing.</td> </tr> <tr> <td>options.entries</td> <td>Specifies whether to emit entries (<code>'emit'</code>) or not (<code>'ignore'</code>). Default is <code>'emit'</code>.</td> </tr> <tr> <td>options.sharedStrings</td> <td>Specifies whether to cache shared strings (<code>'cache'</code>), which inserts them into the respective cell values, or whether to emit them (<code>'emit'</code>) or ignore them (<code>'ignore'</code>), in both of which case the cell value will be a reference to the shared string's index. Default is <code>'cache'</code>.</td> </tr> <tr> <td>options.hyperlinks</td> <td>Specifies whether to cache hyperlinks (<code>'cache'</code>), which inserts them into their respective cells, whether to emit them (<code>'emit'</code>) or whether to ignore them (<code>'ignore'</code>). Default is <code>'cache'</code>.</td> </tr> <tr> <td>options.styles</td> <td>Specifies whether to cache styles (<code>'cache'</code>), which inserts them into their respective rows and cells, or whether to ignore them (<code>'ignore'</code>). Default is <code>'cache'</code>.</td> </tr> <tr> <td>options.worksheets</td> <td>Specifies whether to emit worksheets (<code>'emit'</code>) or not (<code>'ignore'</code>). Default is <code>'emit'</code>.</td> </tr> </tbody> </table> <div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-s1">workbookReader</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">ExcelJS</span><span class="pl-kos">.</span><span class="pl-c1">stream</span><span class="pl-kos">.</span><span class="pl-c1">xlsx</span><span class="pl-kos">.</span><span class="pl-c1">WorkbookReader</span><span class="pl-kos">(</span><span class="pl-s">'./file.xlsx'</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">for</span> <span class="pl-k">await</span> <span class="pl-kos">(</span><span class="pl-k">const</span> <span class="pl-s1">worksheetReader</span> <span class="pl-k">of</span> <span class="pl-s1">workbookReader</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">for</span> <span class="pl-k">await</span> <span class="pl-kos">(</span><span class="pl-k">const</span> <span class="pl-s1">row</span> <span class="pl-k">of</span> <span class="pl-s1">worksheetReader</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-c">// ...</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <p>Please note that <code>worksheetReader</code> returns an array of rows rather than each row individually for performance reasons: <a href="https://github.com/nodejs/node/issues/31979">https://github.com/nodejs/node/issues/31979</a></p> <div class="markdown-heading"><h6 class="heading-element">Iterating over all events(#contents) </h6><a id="user-content-iterating-over-all-eventscontents" class="anchor" aria-label="Permalink: Iterating over all events(#contents)" href="#iterating-over-all-eventscontents"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Events on workbook are 'worksheet', 'shared-strings' and 'hyperlinks'. Events on worksheet are 'row' and 'hyperlinks'.</p> <div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-s1">options</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">sharedStrings</span>: <span class="pl-s">'emit'</span><span class="pl-kos">,</span> <span class="pl-c1">hyperlinks</span>: <span class="pl-s">'emit'</span><span class="pl-kos">,</span> <span class="pl-c1">worksheets</span>: <span class="pl-s">'emit'</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">workbook</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">ExcelJS</span><span class="pl-kos">.</span><span class="pl-c1">stream</span><span class="pl-kos">.</span><span class="pl-c1">xlsx</span><span class="pl-kos">.</span><span class="pl-c1">WorkbookReader</span><span class="pl-kos">(</span><span class="pl-s">'./file.xlsx'</span><span class="pl-kos">,</span> <span class="pl-s1">options</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">for</span> <span class="pl-k">await</span> <span class="pl-kos">(</span><span class="pl-k">const</span> <span class="pl-kos">{</span>eventType<span class="pl-kos">,</span> value<span class="pl-kos">}</span> <span class="pl-k">of</span> <span class="pl-s1">workbook</span><span class="pl-kos">.</span><span class="pl-en">parse</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">switch</span> <span class="pl-kos">(</span><span class="pl-s1">eventType</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">case</span> <span class="pl-s">'shared-strings'</span>: <span class="pl-c">// value is the shared string</span> <span class="pl-k">case</span> <span class="pl-s">'worksheet'</span>: <span class="pl-c">// value is the worksheetReader</span> <span class="pl-k">case</span> <span class="pl-s">'hyperlinks'</span>: <span class="pl-c">// value is the hyperlinksReader</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div> <div class="markdown-heading"><h6 class="heading-element">Readable stream(#contents) </h6><a id="user-content-readable-streamcontents" class="anchor" aria-label="Permalink: Readable stream(#contents)" href="#readable-streamcontents"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>While we strongly encourage to use async iteration, we also expose a streaming interface for backwards compatibility.</p> <div class="highlight highlight-source-js"><pre><span class="pl-k">const</span> <span class="pl-s1">options</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">sharedStrings</span>: <span class="pl-s">'emit'</span><span class="pl-kos">,</span> <span class="pl-c1">hyperlinks</span>: <span class="pl-s">'emit'</span><span class="pl-kos">,</span> <span class="pl-c1">worksheets</span>: <span class="pl-s">'emit'</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-k">const</span> <span class="pl-s1">workbookReader</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">ExcelJS</span><span class="pl-kos">.</span><span class="pl-c1">stream</span><span class="pl-kos">.</span><span class="pl-c1">xlsx</span><span class="pl-kos">.</span><span class="pl-c1">WorkbookReader</span><span class="pl-kos">(</span><span class="pl-s">'./file.xlsx'</span><span class="pl-kos">,</span> <span class="pl-s1">options</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">workbookReader</span><span class="pl-kos">.</span><span class="pl-en">read</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">workbookReader</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'worksheet'</span><span class="pl-kos">,</span> <span class="pl-s1">worksheet</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'row'</span><span class="pl-kos">,</span> <span class="pl-s1">row</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">workbookReader</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'shared-strings'</span><span class="pl-kos">,</span> <span class="pl-s1">sharedString</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span> <span class="pl-c">// ...</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">workbookReader</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'hyperlinks'</span><span class="pl-kos">,</span> <span class="pl-s1">hyperlinksReader</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span> <span class="pl-c">// ...</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">workbookReader</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'end'</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span> <span class="pl-c">// ...</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-s1">workbookReader</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'error'</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-s1">err</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span> <span class="pl-c">// ...</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h1 class="heading-element">Browser<a href="#contents">⬆</a> </h1><a id="user-content-browser" class="anchor" aria-label="Permalink: Browser⬆" href="#browser"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>A portion of this library has been isolated and tested for use within a browser environment.</p> <p>Due to the streaming nature of the workbook reader and workbook writer, these have not been included. Only the document based workbook may be used (see <a href="#create-a-workbook">Create a Workbook</a> for details).</p> <p>For example code using ExcelJS in the browser take a look at the <a href="https://github.com/exceljs/exceljs/tree/master/spec/browser">spec/browser</a> folder in the github repo.</p> <div class="markdown-heading"><h2 class="heading-element">Prebundled<a href="#contents">⬆</a> </h2><a id="user-content-prebundled" class="anchor" aria-label="Permalink: Prebundled⬆" href="#prebundled"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>The following files are pre-bundled and included inside the dist folder.</p> <ul> <li>exceljs.js</li> <li>exceljs.min.js</li> </ul> <div class="markdown-heading"><h1 class="heading-element">Value Types<a href="#contents">⬆</a> </h1><a id="user-content-value-types" class="anchor" aria-label="Permalink: Value Types⬆" href="#value-types"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>The following value types are supported.</p> <div class="markdown-heading"><h2 class="heading-element">Null Value<a href="#contents">⬆</a> </h2><a id="user-content-null-value" class="anchor" aria-label="Permalink: Null Value⬆" href="#null-value"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Enum: Excel.ValueType.Null</p> <p>A null value indicates an absence of value and will typically not be stored when written to file (except for merged cells). It can be used to remove the value from a cell.</p> <p>E.g.</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-c1">null</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Merge Cell<a href="#contents">⬆</a> </h2><a id="user-content-merge-cell" class="anchor" aria-label="Permalink: Merge Cell⬆" href="#merge-cell"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Enum: Excel.ValueType.Merge</p> <p>A merge cell is one that has its value bound to another 'master' cell. Assigning to a merge cell will cause the master's cell to be modified.</p> <div class="markdown-heading"><h2 class="heading-element">Number Value<a href="#contents">⬆</a> </h2><a id="user-content-number-value" class="anchor" aria-label="Permalink: Number Value⬆" href="#number-value"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Enum: Excel.ValueType.Number</p> <p>A numeric value.</p> <p>E.g.</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-c1">5</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A2'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-c1">3.14159</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">String Value<a href="#contents">⬆</a> </h2><a id="user-content-string-value" class="anchor" aria-label="Permalink: String Value⬆" href="#string-value"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Enum: Excel.ValueType.String</p> <p>A simple text string.</p> <p>E.g.</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-s">'Hello, World!'</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Date Value<a href="#contents">⬆</a> </h2><a id="user-content-date-value" class="anchor" aria-label="Permalink: Date Value⬆" href="#date-value"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Enum: Excel.ValueType.Date</p> <p>A date value, represented by the JavaScript Date type.</p> <p>E.g.</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Date</span><span class="pl-kos">(</span><span class="pl-c1">2017</span><span class="pl-kos">,</span> <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-c1">15</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Hyperlink Value<a href="#contents">⬆</a> </h2><a id="user-content-hyperlink-value" class="anchor" aria-label="Permalink: Hyperlink Value⬆" href="#hyperlink-value"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Enum: Excel.ValueType.Hyperlink</p> <p>A URL with both text and link value.</p> <p>E.g.</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// link to web</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">text</span>: <span class="pl-s">'www.mylink.com'</span><span class="pl-kos">,</span> <span class="pl-c1">hyperlink</span>: <span class="pl-s">'http://www.mylink.com'</span><span class="pl-kos">,</span> <span class="pl-c1">tooltip</span>: <span class="pl-s">'www.mylink.com'</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// internal link</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">text</span>: <span class="pl-s">'Sheet2'</span><span class="pl-kos">,</span> <span class="pl-c1">hyperlink</span>: <span class="pl-s">'#\'Sheet2\'!A1'</span> <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Formula Value<a href="#contents">⬆</a> </h2><a id="user-content-formula-value" class="anchor" aria-label="Permalink: Formula Value⬆" href="#formula-value"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Enum: Excel.ValueType.Formula</p> <p>An Excel formula for calculating values on the fly. Note that while the cell type will be Formula, the cell may have an effectiveType value that will be derived from the result value.</p> <p>Note that ExcelJS cannot process the formula to generate a result, it must be supplied.</p> <p>Note that function semantic names must be in English and the separator must be a comma.</p> <p>E.g.</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A3'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">formula</span>: <span class="pl-s">'A1+A2'</span><span class="pl-kos">,</span> <span class="pl-c1">result</span>: <span class="pl-c1">7</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A3'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">formula</span>: <span class="pl-s">'SUM(A1,A2)'</span><span class="pl-kos">,</span> <span class="pl-c1">result</span>: <span class="pl-c1">7</span> <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div> <p>Cells also support convenience getters to access the formula and result:</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A3'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">formula</span> <span class="pl-c1">===</span> <span class="pl-s">'A1+A2'</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A3'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">result</span> <span class="pl-c1">===</span> <span class="pl-c1">7</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Shared Formula<a href="#contents">⬆</a> </h3><a id="user-content-shared-formula" class="anchor" aria-label="Permalink: Shared Formula⬆" href="#shared-formula"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Shared formulae enhance the compression of the xlsx document by decreasing the repetition of text within the worksheet xml. The top-left cell in a range is the designated master and will hold the formula that all the other cells in the range will derive from. The other 'slave' cells can then refer to this master cell instead of redefining the whole formula again. Note that the master formula will be translated to the slave cells in the usual Excel fashion so that references to other cells will be shifted down and to the right depending on the slave's offset to the master. For example: if the master cell A2 has a formula referencing A1 then if cell B2 shares A2's formula, then it will reference B1.</p> <p>A master formula can be assigned to a cell along with the slave cells in its range</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A2'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">formula</span>: <span class="pl-s">'A1'</span><span class="pl-kos">,</span> <span class="pl-c1">result</span>: <span class="pl-c1">10</span><span class="pl-kos">,</span> <span class="pl-c1">shareType</span>: <span class="pl-s">'shared'</span><span class="pl-kos">,</span> <span class="pl-c1">ref</span>: <span class="pl-s">'A2:B3'</span> <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div> <p>A shared formula can be assigned to a cell using a new value form:</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'B2'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">sharedFormula</span>: <span class="pl-s">'A2'</span><span class="pl-kos">,</span> <span class="pl-c1">result</span>: <span class="pl-c1">10</span> <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div> <p>This specifies that the cell B2 is a formula that will be derived from the formula in A2 and its result is 10.</p> <p>The formula convenience getter will translate the formula in A2 to what it should be in B2:</p> <div class="highlight highlight-source-js"><pre><span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'B2'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">formula</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">to</span><span class="pl-kos">.</span><span class="pl-en">equal</span><span class="pl-kos">(</span><span class="pl-s">'B1'</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p>Shared formulae can be assigned into a sheet using the 'fillFormula' function:</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// set A1 to starting number</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-c">// fill A2 to A10 with ascending count starting from A1</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">fillFormula</span><span class="pl-kos">(</span><span class="pl-s">'A2:A10'</span><span class="pl-kos">,</span> <span class="pl-s">'A1+1'</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-c1">2</span><span class="pl-kos">,</span><span class="pl-c1">3</span><span class="pl-kos">,</span><span class="pl-c1">4</span><span class="pl-kos">,</span><span class="pl-c1">5</span><span class="pl-kos">,</span><span class="pl-c1">6</span><span class="pl-kos">,</span><span class="pl-c1">7</span><span class="pl-kos">,</span><span class="pl-c1">8</span><span class="pl-kos">,</span><span class="pl-c1">9</span><span class="pl-kos">,</span><span class="pl-c1">10</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p>fillFormula can also use a callback function to calculate the value at each cell</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// fill A2 to A100 with ascending count starting from A1</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">fillFormula</span><span class="pl-kos">(</span><span class="pl-s">'A2:A100'</span><span class="pl-kos">,</span> <span class="pl-s">'A1+1'</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-s1">row</span><span class="pl-kos">,</span> <span class="pl-s1">col</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-s1">row</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h3 class="heading-element">Formula Type<a href="#contents">⬆</a> </h3><a id="user-content-formula-type" class="anchor" aria-label="Permalink: Formula Type⬆" href="#formula-type"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>To distinguish between real and translated formula cells, use the formulaType getter:</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A3'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">formulaType</span> <span class="pl-c1">===</span> <span class="pl-v">Enums</span><span class="pl-kos">.</span><span class="pl-c1">FormulaType</span><span class="pl-kos">.</span><span class="pl-c1">Master</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'B3'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">formulaType</span> <span class="pl-c1">===</span> <span class="pl-v">Enums</span><span class="pl-kos">.</span><span class="pl-c1">FormulaType</span><span class="pl-kos">.</span><span class="pl-c1">Shared</span><span class="pl-kos">;</span></pre></div> <p>Formula type has the following values:</p> <table> <thead> <tr> <th>Name</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>Enums.FormulaType.None</td> <td>0</td> </tr> <tr> <td>Enums.FormulaType.Master</td> <td>1</td> </tr> <tr> <td>Enums.FormulaType.Shared</td> <td>2</td> </tr> </tbody> </table> <div class="markdown-heading"><h3 class="heading-element">Array Formula<a href="#contents">⬆</a> </h3><a id="user-content-array-formula" class="anchor" aria-label="Permalink: Array Formula⬆" href="#array-formula"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>A new way of expressing shared formulae in Excel is the array formula. In this form, the master cell is the only cell that contains any information relating to a formula. It contains the shareType 'array' along with the range of cells it applies to and the formula that will be copied. The rest of the cells are regular cells with regular values.</p> <p>Note: array formulae are not translated in the way shared formulae are. So if master cell A2 refers to A1, then slave cell B2 will also refer to A1.</p> <p>E.g.</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// assign array formula to A2:B3</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A2'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">formula</span>: <span class="pl-s">'A1'</span><span class="pl-kos">,</span> <span class="pl-c1">result</span>: <span class="pl-c1">10</span><span class="pl-kos">,</span> <span class="pl-c1">shareType</span>: <span class="pl-s">'array'</span><span class="pl-kos">,</span> <span class="pl-c1">ref</span>: <span class="pl-s">'A2:B3'</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// it may not be necessary to fill the rest of the values in the sheet</span></pre></div> <p>The fillFormula function can also be used to fill an array formula</p> <div class="highlight highlight-source-js"><pre><span class="pl-c">// fill A2:B3 with array formula "A1"</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">fillFormula</span><span class="pl-kos">(</span><span class="pl-s">'A2:B3'</span><span class="pl-kos">,</span> <span class="pl-s">'A1'</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">,</span><span class="pl-c1">1</span><span class="pl-kos">,</span><span class="pl-c1">1</span><span class="pl-kos">,</span><span class="pl-c1">1</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-s">'array'</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Rich Text Value<a href="#contents">⬆</a> </h2><a id="user-content-rich-text-value" class="anchor" aria-label="Permalink: Rich Text Value⬆" href="#rich-text-value"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Enum: Excel.ValueType.RichText</p> <p>Rich, styled text.</p> <p>E.g.</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">richText</span>: <span class="pl-kos">[</span> <span class="pl-kos">{</span> <span class="pl-c1">text</span>: <span class="pl-s">'This is '</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-c1">font</span>: <span class="pl-kos">{</span><span class="pl-c1">italic</span>: <span class="pl-c1">true</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">text</span>: <span class="pl-s">'italic'</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Boolean Value<a href="#contents">⬆</a> </h2><a id="user-content-boolean-value" class="anchor" aria-label="Permalink: Boolean Value⬆" href="#boolean-value"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Enum: Excel.ValueType.Boolean</p> <p>E.g.</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A2'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-c1">false</span><span class="pl-kos">;</span></pre></div> <div class="markdown-heading"><h2 class="heading-element">Error Value<a href="#contents">⬆</a> </h2><a id="user-content-error-value" class="anchor" aria-label="Permalink: Error Value⬆" href="#error-value"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Enum: Excel.ValueType.Error</p> <p>E.g.</p> <div class="highlight highlight-source-js"><pre><span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A1'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">error</span>: <span class="pl-s">'#N/A'</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-s1">worksheet</span><span class="pl-kos">.</span><span class="pl-en">getCell</span><span class="pl-kos">(</span><span class="pl-s">'A2'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">value</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">error</span>: <span class="pl-s">'#VALUE!'</span> <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div> <p>The current valid Error text values are:</p> <table> <thead> <tr> <th>Name</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>Excel.ErrorValue.NotApplicable</td> <td>#N/A</td> </tr> <tr> <td>Excel.ErrorValue.Ref</td> <td>#REF!</td> </tr> <tr> <td>Excel.ErrorValue.Name</td> <td>#NAME?</td> </tr> <tr> <td>Excel.ErrorValue.DivZero</td> <td>#DIV/0!</td> </tr> <tr> <td>Excel.ErrorValue.Null</td> <td>#NULL!</td> </tr> <tr> <td>Excel.ErrorValue.Value</td> <td>#VALUE!</td> </tr> <tr> <td>Excel.ErrorValue.Num</td> <td>#NUM!</td> </tr> </tbody> </table> <div class="markdown-heading"><h1 class="heading-element">Interface Changes<a href="#contents">⬆</a> </h1><a id="user-content-interface-changes" class="anchor" aria-label="Permalink: Interface Changes⬆" href="#interface-changes"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Every effort is made to make a good consistent interface that doesn't break through the versions but regrettably, now and then some things have to change for the greater good.</p> <div class="markdown-heading"><h2 class="heading-element">0.1.0<a href="#contents">⬆</a> </h2><a id="user-content-010" class="anchor" aria-label="Permalink: 0.1.0⬆" href="#010"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="markdown-heading"><h3 class="heading-element">Worksheet.eachRow<a href="#contents">⬆</a> </h3><a id="user-content-worksheeteachrow" class="anchor" aria-label="Permalink: Worksheet.eachRow⬆" href="#worksheeteachrow"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>The arguments in the callback function to Worksheet.eachRow have been swapped and changed; it was function(rowNumber,rowValues), now it is function(row, rowNumber) which gives it a look and feel more like the underscore (_.each) function and priorities the row object over the row number.</p> <div class="markdown-heading"><h3 class="heading-element">Worksheet.getRow<a href="#contents">⬆</a> </h3><a id="user-content-worksheetgetrow" class="anchor" aria-label="Permalink: Worksheet.getRow⬆" href="#worksheetgetrow"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>This function has changed from returning a sparse array of cell values to returning a Row object. This enables accessing row properties and will facilitate managing row styles and so on.</p> <p>The sparse array of cell values is still available via Worksheet.getRow(rowNumber).values;</p> <div class="markdown-heading"><h2 class="heading-element">0.1.1<a href="#contents">⬆</a> </h2><a id="user-content-011" class="anchor" aria-label="Permalink: 0.1.1⬆" href="#011"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="markdown-heading"><h3 class="heading-element">cell.model<a href="#contents">⬆</a> </h3><a id="user-content-cellmodel" class="anchor" aria-label="Permalink: cell.model⬆" href="#cellmodel"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>cell.styles renamed to cell.style</p> <div class="markdown-heading"><h2 class="heading-element">0.2.44<a href="#contents">⬆</a> </h2><a id="user-content-0244" class="anchor" aria-label="Permalink: 0.2.44⬆" href="#0244"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Promises returned from functions switched from Bluebird to native node Promise which can break calling code if they rely on Bluebird's extra features.</p> <p>To mitigate this the following two changes were added to 0.3.0:</p> <ul> <li>A more fully featured and still browser compatible promise lib is used by default. This lib supports many of the features of Bluebird but with a much lower footprint.</li> <li>An option to inject a different Promise implementation. See <a href="#config">Config</a> section for more details.</li> </ul> <div class="markdown-heading"><h1 class="heading-element">Config<a href="#contents">⬆</a> </h1><a id="user-content-config" class="anchor" aria-label="Permalink: Config⬆" href="#config"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>ExcelJS now supports dependency injection for the promise library. You can restore Bluebird promises by including the following code in your module...</p> <div class="highlight highlight-source-js"><pre><span class="pl-v">ExcelJS</span><span class="pl-kos">.</span><span class="pl-c1">config</span><span class="pl-kos">.</span><span class="pl-en">setValue</span><span class="pl-kos">(</span><span class="pl-s">'promise'</span><span class="pl-kos">,</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'bluebird'</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> <p>Please note: I have tested ExcelJS with bluebird specifically (since up until recently this was the library it used). From the tests I have done it will not work with Q.</p> <div class="markdown-heading"><h1 class="heading-element">Caveats<a href="#contents">⬆</a> </h1><a id="user-content-caveats" class="anchor" aria-label="Permalink: Caveats⬆" href="#caveats"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="markdown-heading"><h2 class="heading-element">Dist Folder<a href="#contents">⬆</a> </h2><a id="user-content-dist-folder" class="anchor" aria-label="Permalink: Dist Folder⬆" href="#dist-folder"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Before publishing this module, the source code is transpiled and otherwise processed before being placed in a dist/ folder. This README identifies two files - a browserified bundle and minified version. No other contents of the dist/ folder are guaranteed in any way other than the file specified as "main" in the package.json</p> <div class="markdown-heading"><h1 class="heading-element">Known Issues<a href="#contents">⬆</a> </h1><a id="user-content-known-issues" class="anchor" aria-label="Permalink: Known Issues⬆" href="#known-issues"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <div class="markdown-heading"><h2 class="heading-element">Testing with Puppeteer<a href="#contents">⬆</a> </h2><a id="user-content-testing-with-puppeteer" class="anchor" aria-label="Permalink: Testing with Puppeteer⬆" href="#testing-with-puppeteer"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>The test suite included in this lib includes a small script executed in a headless browser to validate the bundled packages. At the time of this writing, it appears that this test does not play nicely in the Windows Linux subsystem.</p> <p>For this reason, the browser test can be disabled by the existence of a file named .disable-test-browser</p> <div class="highlight highlight-source-shell"><pre>sudo apt-get install libfontconfig</pre></div> <div class="markdown-heading"><h2 class="heading-element">Splice vs Merge<a href="#contents">⬆</a> </h2><a id="user-content-splice-vs-merge" class="anchor" aria-label="Permalink: Splice vs Merge⬆" href="#splice-vs-merge"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>If any splice operation affects a merged cell, the merge group will not be moved correctly</p> <div class="markdown-heading"><h1 class="heading-element">Release History<a href="#contents">⬆</a> </h1><a id="user-content-release-history" class="anchor" aria-label="Permalink: Release History⬆" href="#release-history"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <table> <thead> <tr> <th>Version</th> <th>Changes</th> </tr> </thead> <tbody> <tr> <td>0.0.9</td> <td><ul><li><a href="#number-formats">Number Formats</a></li></ul></td> </tr> <tr> <td>0.1.0</td> <td><ul> <li>Bug Fixes<ul><li>"<" and ">" text characters properly rendered in xlsx</li></ul> </li> <li><a href="#columns">Better Column control</a></li> <li><a href="#rows">Better Row control</a></li> </ul></td> </tr> <tr> <td>0.1.1</td> <td><ul> <li>Bug Fixes<ul> <li>More textual data written properly to xml (including text, hyperlinks, formula results and format codes)</li> <li>Better date format code recognition</li> </ul> </li> <li><a href="#fonts">Cell Font Style</a></li> </ul></td> </tr> <tr> <td>0.1.2</td> <td><ul><li>Fixed potential race condition on zip write</li></ul></td> </tr> <tr> <td>0.1.3</td> <td><ul> <li><a href="#alignment">Cell Alignment Style</a></li> <li><a href="#rows">Row Height</a></li> <li>Some Internal Restructuring</li> </ul></td> </tr> <tr> <td>0.1.5</td> <td><ul> <li>Bug Fixes<ul> <li>Now handles 10 or more worksheets in one workbook</li> <li>theme1.xml file properly added and referenced</li> </ul> </li> <li><a href="#borders">Cell Borders</a></li> </ul></td> </tr> <tr> <td>0.1.6</td> <td><ul> <li>Bug Fixes<ul><li>More compatible theme1.xml included in XLSX file</li></ul> </li> <li><a href="#fills">Cell Fills</a></li> </ul></td> </tr> <tr> <td>0.1.8</td> <td><ul> <li>Bug Fixes<ul> <li>More compatible theme1.xml included in XLSX file</li> <li>Fixed filename case issue</li> </ul> </li> <li><a href="#fills">Cell Fills</a></li> </ul></td> </tr> <tr> <td>0.1.9</td> <td><ul> <li>Bug Fixes<ul> <li>Added docProps files to satisfy Mac Excel users</li> <li>Fixed filename case issue</li> <li>Fixed worksheet id issue</li> </ul> </li> <li><a href="#set-workbook-properties">Core Workbook Properties</a></li> </ul></td> </tr> <tr> <td>0.1.10</td> <td><ul> <li>Bug Fixes<ul><li>Handles File Not Found error</li></ul> </li> <li><a href="#csv">CSV Files</a></li> </ul></td> </tr> <tr> <td>0.1.11</td> <td><ul> <li>Bug Fixes<ul><li>Fixed Vertical Middle Alignment Issue</li></ul> </li> <li><a href="#styles">Row and Column Styles</a></li> <li><a href="#rows">Worksheet.eachRow supports options</a></li> <li><a href="#rows">Row.eachCell supports options</a></li> <li><a href="#columns">New function Column.eachCell</a></li> </ul></td> </tr> <tr> <td>0.2.0</td> <td><ul> <li> <a href="#streaming-xlxs-writer">Streaming XLSX Writer</a><ul><li>At long last ExcelJS can support writing massive XLSX files in a scalable memory efficient manner. Performance has been optimised and even smaller spreadsheets can be faster to write than the document writer. Options have been added to control the use of shared strings and styles as these can both have a considerable effect on performance</li></ul> </li> <li> <a href="#rows">Worksheet.lastRow</a><ul><li>Access the last editable row in a worksheet.</li></ul> </li> <li> <a href="#rows">Row.commit()</a><ul><li>For streaming writers, this method commits the row (and any previous rows) to the stream. Committed rows will no longer be editable (and are typically deleted from the worksheet object). For Document type workbooks, this method has no effect.</li></ul> </li> </ul></td> </tr> <tr> <td>0.2.2</td> <td><ul><li> <a href="https://pbs.twimg.com/profile_images/2933552754/fc8c70829ee964c5542ae16453503d37.jpeg" rel="nofollow">One Billion Cells</a><ul><li>Achievement Unlocked: A simple test using ExcelJS has created a spreadsheet with 1,000,000,000 cells. Made using random data with 100,000,000 rows of 10 cells per row. I cannot validate the file yet as Excel will not open it and I have yet to implement the streaming reader but I have every confidence that it is good since 1,000,000 rows loads ok.</li></ul> </li></ul></td> </tr> <tr> <td>0.2.3</td> <td><ul> <li>Bug Fixes<ul><li> <a href="https://github.com/exceljs/exceljs/issues/18">Merge Cell Styles</a><ul><li>Merged cells now persist (and parse) their styles.</li></ul> </li></ul> </li> <li> <a href="#streaming-xlxs-writer">Streaming XLSX Writer</a><ul><li>At long last ExcelJS can support writing massive XLSX files in a scalable memory efficient manner. Performance has been optimised and even smaller spreadsheets can be faster to write than the document writer. Options have been added to control the use of shared strings and styles as these can both have a considerable effect on performance</li></ul> </li> <li> <a href="#rows">Worksheet.lastRow</a><ul><li>Access the last editable row in a worksheet.</li></ul> </li> <li> <a href="#rows">Row.commit()</a><ul><li>For streaming writers, this method commits the row (and any previous rows) to the stream. Committed rows will no longer be editable (and are typically deleted from the worksheet object). For Document type workbooks, this method has no effect.</li></ul> </li> </ul></td> </tr> <tr> <td>0.2.4</td> <td><ul> <li>Bug Fixes<ul><li> <a href="https://github.com/exceljs/exceljs/issues/27">Worksheets with Ampersand Names</a><ul><li>Worksheet names are now xml-encoded and should work with all xml compatible characters</li></ul> </li></ul> </li> <li> <a href="#rows">Row.hidden</a> & <a href="#columns">Column.hidden</a><ul><li>Rows and Columns now support the hidden attribute.</li></ul> </li> <li> <a href="#worksheet">Worksheet.addRows</a><ul><li>New function to add an array of rows (either array or object form) to the end of a worksheet.</li></ul> </li> </ul></td> </tr> <tr> <td>0.2.6</td> <td><ul> <li>Bug Fixes<ul><li> <a href="https://github.com/exceljs/exceljs/issues/87">invalid signature: 0x80014</a>: Thanks to <a href="https://github.com/hasanlussa">hasanlussa</a> for the PR</li></ul> </li> <li> <a href="#defined-names">Defined Names</a><ul><li>Cells can now have assigned names which may then be used in formulas.</li></ul> </li> <li>Converted Bluebird.defer() to new Bluebird(function(resolve, reject){}). Thanks to user <a href="https://github.com/Nishchit14">Nishchit</a> for the Pull Request</li> </ul></td> </tr> <tr> <td>0.2.7</td> <td><ul><li> <a href="#data-validations">Data Validations</a><ul><li>Cells can now define validations that controls the valid values the cell can have</li></ul> </li></ul></td> </tr> <tr> <td>0.2.8</td> <td><ul> <li> <a href="https://github.com/wmakeev/exceljs/blob/HEAD/rich-text">Rich Text Value</a><ul><li>Cells now support <b><i>in-cell</i></b> formatting - Thanks to <a href="https://github.com/pvadam">Peter ADAM</a> </li></ul> </li> <li>Fixed typo in README - Thanks to <a href="https://github.com/MRdNk">MRdNk</a> </li> <li>Fixing emit in worksheet-reader - Thanks to <a href="https://github.com/alangunning">Alan Gunning</a> </li> <li>Clearer Docs - Thanks to <a href="https://github.com/miensol">miensol</a> </li> </ul></td> </tr> <tr> <td>0.2.9</td> <td><ul><li>Fixed "read property 'richText' of undefined error. Thanks to <a href="https://github.com/james075">james075</a> </li></ul></td> </tr> <tr> <td>0.2.10</td> <td><ul><li>Refactoring Complete. All unit and integration tests pass.</li></ul></td> </tr> <tr> <td>0.2.11</td> <td><ul> <li> <a href="#outline-level">Outline Levels</a>. Thanks to <a href="https://github.com/cricri">cricri</a> for the contribution.</li> <li><a href="#worksheet-properties">Worksheet Properties</a></li> <li>Further refactoring of worksheet writer.</li> </ul></td> </tr> <tr> <td>0.2.12</td> <td><ul><li> <a href="#worksheet-views">Sheet Views</a>. Thanks to <a href="https://github.com/cricri">cricri</a> again for the contribution.</li></ul></td> </tr> <tr> <td>0.2.13</td> <td><ul> <li>Fix for <a href="https://github.com/exceljs/exceljs/issues">exceljs might be vulnerable for regular expression denial of service</a>. Kudos to <a href="https://github.com/yonjah">yonjah</a> and <a href="https://www.youtube.com/watch?v=wCfE-9bhY2Y" rel="nofollow">Josh Emerson</a> for the resolution.</li> <li>Fix for <a href="https://github.com/exceljs/exceljs/issues/162">Multiple Sheets opens in 'Group' mode in Excel</a>. My bad - overzealous sheet view code.</li> <li>Also fix for empty sheet generating invalid xlsx.</li> </ul></td> </tr> <tr> <td>0.2.14</td> <td><ul> <li>Fix for <a href="https://github.com/exceljs/exceljs/issues">exceljs might be vulnerable for regular expression denial of service</a>. Kudos to <a href="https://github.com/yonjah">yonjah</a> and <a href="https://www.youtube.com/watch?v=wCfE-9bhY2Y" rel="nofollow">Josh Emerson</a> for the resolution.</li> <li>Fixed <a href="https://github.com/exceljs/exceljs/issues/162">Multiple Sheets opens in 'Group' mode in Excel</a> again. Added <a href="#workbook-views">Workbook views</a>.</li> <li>Also fix for empty sheet generating invalid xlsx.</li> </ul></td> </tr> <tr> <td>0.2.15</td> <td><ul><li>Added <a href="#page-setup">Page Setup Properties</a>. Thanks to <a href="https://github.com/jackkum">Jackkum</a> for the PR</li></ul></td> </tr> <tr> <td>0.2.16</td> <td><ul><li>New <a href="#page-setup">Page Setup</a> Property: Print Area</li></ul></td> </tr> <tr> <td>0.2.17</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/114">Fix a bug on phonetic characters</a>. This fixes an issue related to reading workbooks with phonetic text in. Note phonetic text is not properly supported yet - just properly ignored. Thanks to <a href="https://github.com/zephyrrider">zephyrrider</a> and <a href="https://github.com/gen6033">gen6033</a> for the contribution.</li></ul></td> </tr> <tr> <td>0.2.18</td> <td><ul> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/175">Fix regression #150: Stream API fails to write XLSX files</a>. Apologies for the regression! Thanks to <a href="https://github.com/danieleds">danieleds</a> for the fix.</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/114">Fix a bug on phonetic characters</a>. This fixes an issue related to reading workbooks with phonetic text in. Note phonetic text is not properly supported yet - just properly ignored. Thanks to <a href="https://github.com/zephyrrider">zephyrrider</a> and <a href="https://github.com/gen6033">gen6033</a> for the contribution.</li> </ul></td> </tr> <tr> <td>0.2.19</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/119">Update xlsx.js #119</a>. This should make parsing more resilient to open-office documents. Thanks to <a href="https://github.com/nvitaterna">nvitaterna</a> for the contribution.</li></ul></td> </tr> <tr> <td>0.2.20</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/179">Changes from exceljs/exceljs#127 applied to latest version #179</a>. Fixes parsing of defined name values. Thanks to <a href="https://github.com/agdevbridge">agdevbridge</a> and <a href="https://github.com/priitliivak">priitliivak</a> for the contribution.</li></ul></td> </tr> <tr> <td>0.2.21</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/135">color tabs for worksheet-writer #135</a>. Modified the behaviour to print deprecation warning as tabColor has moved into options.properties. Thanks to <a href="https://github.com/ethanlook">ethanlook</a> for the contribution.</li></ul></td> </tr> <tr> <td>0.2.22</td> <td><ul> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/136">Throw legible error when failing Value.getType() #136</a>. Thanks to <a href="https://github.com/wulfsolter">wulfsolter</a> for the contribution.</li> <li>Honourable mention to contributors whose PRs were fixed before I saw them:<ul> <li><a href="https://github.com/haoliangyu">haoliangyu</a></li> <li><a href="https://github.com/wulfsolter">wulfsolter</a></li> </ul> </li> </ul></td> </tr> <tr> <td>0.2.23</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/137">Fall back to JSON.stringify() if unknown Cell.Type #137</a> with some modification. If a cell value is assigned to an unrecognisable javascript object, the stored value in xlsx and csv files will be JSON stringified. Note that if the file is read again, no attempt will be made to parse the stringified JSON text. Thanks to <a href="https://github.com/wulfsolter">wulfsolter</a> for the contribution.</li></ul></td> </tr> <tr> <td>0.2.24</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/166">Protect cell fix #166</a>. This does not mean full support for protected cells merely that the parser is not confused by the extra xml. Thanks to <a href="https://github.com/jayflo">jayflo</a> for the contribution.</li></ul></td> </tr> <tr> <td>0.2.25</td> <td><ul><li>Added functions to delete cells, rows and columns from a worksheet. Modelled after the Array splice method, the functions allow cells, rows and columns to be deleted (and optionally inserted). See <a href="#columns">Columns</a> and <a href="#rows">Rows</a> for details.<br>Note: <a href="#splice-vs-merge">Not compatible with cell merges</a> </li></ul></td> </tr> <tr> <td>0.2.26</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/184">Update border-xform.js #184</a>Border edges without style will be parsed and rendered as no-border. Thanks to <a href="https://github.com/skumarnk2">skumarnk2</a> for the contribution.</li></ul></td> </tr> <tr> <td>0.2.27</td> <td><ul> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/187">Pass views to worksheet-writer #187</a>. Now also passes views to worksheet-writer. Thanks to <a href="https://github.com/Temetz">Temetz</a> for the contribution.</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/189">Do not escape xml characters when using shared strings #189</a>. Fixing bug in shared strings. Thanks to <a href="https://github.com/tkirda">tkirda</a> for the contribution.</li> </ul></td> </tr> <tr> <td>0.2.28</td> <td><ul> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/190">Fix tiny bug [Update hyperlink-map.js] #190</a>Thanks to <a href="https://github.com/lszlkss">lszlkss</a> for the contribution.</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/196">fix typo on sheet view showGridLines option #196</a> "showGridlines" should have been "showGridLines". Thanks to <a href="https://github.com/gadiaz1">gadiaz1</a> for the contribution.</li> </ul></td> </tr> <tr> <td>0.2.29</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/199">Fire finish event instead of end event on write stream #199</a> and <a href="https://github.com/exceljs/exceljs/pull/200">Listen for finish event on zip stream instead of middle stream #200</a>. Fixes issues with stream completion events. Thanks to <a href="https://github.com/junajan">junajan</a> for the contribution.</li></ul></td> </tr> <tr> <td>0.2.30</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/201">Fix issue #178 #201</a>. Adds the following properties to workbook:<ul> <li>title</li> <li>subject</li> <li>keywords</li> <li>category</li> <li>description</li> <li>company</li> <li>manager</li> </ul>Thanks to <a href="https://github.com/stavenko">stavenko</a> for the contribution.</li></ul></td> </tr> <tr> <td>0.2.31</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/203">Fix issue #163: the "spans" attribute of the row element is optional #203</a>. Now xlsx parsing will handle documents without row spans. Thanks to <a href="https://github.com/arturas-vitkauskas">arturas-vitkauskas</a> for the contribution.</li></ul></td> </tr> <tr> <td>0.2.32</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/208">Fix issue 206 #208</a>. Fixes issue reading xlsx files that have been printed. Also adds "lastPrinted" property to Workbook. Thanks to <a href="https://github.com/arturas-vitkauskas">arturas-vitkauskas</a> for the contribution.</li></ul></td> </tr> <tr> <td>0.2.33</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/210">Allow styling of cells with no value. #210</a>. Includes Null type cells with style in the rendering parsing. Thanks to <a href="https://github.com/oferns">oferns</a> for the contribution.</li></ul></td> </tr> <tr> <td>0.2.34</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/212">Fix "Unexpected xml node in parseOpen" bug in LibreOffice documents for attributes dc:language and cp:revision #212</a>. Thanks to <a href="https://github.com/jessica-jordan">jessica-jordan</a> for the contribution.</li></ul></td> </tr> <tr> <td>0.2.35</td> <td><ul><li>Fixed <a href="https://github.com/exceljs/exceljs/issues/74">Getting a column/row count #74</a>. <a href="#worksheet-metrics">Worksheet</a> now has rowCount and columnCount properties (and actual variants), <a href="https://github.com/wmakeev/exceljs/blob/HEAD/row">Row</a> has cellCount.</li></ul></td> </tr> <tr> <td>0.2.36</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/217">Stream reader fixes #217</a>. Thanks to <a href="https://github.com/kturney">kturney</a> for the contribution.</li></ul></td> </tr> <tr> <td>0.2.37</td> <td><ul> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/225">Fix output order of Sheet Properties #225</a>. Thanks to <a href="https://github.com/keeneym">keeneym</a> for the contribution.</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/231">remove empty worksheet[0] from _worksheets #231</a>. Thanks to <a href="https://github.com/pookong">pookong</a> for the contribution.</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/232">do not skip empty string in shared strings so that indexes match #232</a>. Thanks again to <a href="https://github.com/pookong">pookong</a> for the contribution.</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/233">use shared strings for streamed writes #233</a>. Thanks again to <a href="https://github.com/pookong">pookong</a> for the contribution.</li> </ul></td> </tr> <tr> <td>0.2.38</td> <td><ul> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/236">Add a comment for issue #216 #236</a>. Thanks to <a href="https://github.com/jsalwen">jsalwen</a> for the contribution.</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/237">Start on support for 1904 based dates #237</a>. Fixed date handling in documents with the 1904 flag set. Thanks to <a href="https://github.com/holm">holm</a> for the contribution.</li> </ul></td> </tr> <tr> <td>0.2.39</td> <td><ul> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/245">Stops Bluebird warning about unreturned promise #245</a>. Thanks to <a href="https://github.com/robinbullocks4rb">robinbullocks4rb</a> for the contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/247">Added missing dependency: col-cache.js #247</a>. Thanks to <a href="https://github.com/Manish2005">Manish2005</a> for the contribution. </li> </ul></td> </tr> <tr> <td>0.2.42</td> <td><ul> <li>Browser Compatible!<ul><li>Well mostly. I have added a browser sub-folder that contains a browserified bundle and an index.js that can be used to generate another. See <a href="#browser">Browser</a> section for details.</li></ul> </li> <li>Fixed corrupted theme.xml. Apologies for letting that through.</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/253">[BUGFIX] data validation formulae undefined #253</a>. Thanks to <a href="https://github.com/jayflo">jayflo</a> for the contribution.</li> </ul></td> </tr> <tr> <td>0.2.43</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/255">added a (maybe partial) solution to issue 99. i wasn't able to create an appropriate test #255</a>. This fixes <a href="https://github.com/exceljs/exceljs/issues/99">Too few data or empty worksheet generate malformed excel file #99</a>. Thanks to <a href="https://github.com/mminuti">mminuti</a> for the contribution.</li></ul></td> </tr> <tr> <td>0.2.44</td> <td><ul><li>Reduced Dependencies.<ul><li>Goodbye lodash, goodbye bluebird. Minified bundle is now just over half what it was in the first version.</li></ul> </li></ul></td> </tr> <tr> <td>0.2.45</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/256">Sheets with hyperlinks and data validations are corrupted #256</a>. Thanks to <a href="https://github.com/simon-stoic">simon-stoic</a> for the contribution.</li></ul></td> </tr> <tr> <td>0.2.46</td> <td><ul> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/259">Exclude character controls from XML output. Fixes #234 #262</a>. Thanks to <a href="https://github.com/holm">holm</a> for the contribution.</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/262">Add support for identifier #259</a>. This fixes <a href="https://github.com/exceljs/exceljs/issues/234">Broken XLSX because of "vertical tab" ascii character in a cell #234</a>. Thanks to <a href="https://github.com/NOtherDev">NOtherDev</a> for the contribution.</li> </ul></td> </tr> <tr> <td>0.3.0</td> <td><ul> <li>Addressed <a href="https://github.com/exceljs/exceljs/issues/266">Breaking change removing bluebird #266</a>. Appologies for any inconvenience.</li> <li>Added Promise library dependency injection. See <a href="#config">Config</a> section for more details.</li> </ul></td> </tr> <tr> <td>0.3.1</td> <td><ul> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/279">Update dependencies #279</a>. Thanks to <a href="https://github.com/holm">holm</a> for the contribution.</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/267">Minor fixes for stream handling #267</a>. Thanks to <a href="https://github.com/holm">holm</a> for the contribution.</li> <li>Added automated tests in phantomjs for the browserified code.</li> </ul></td> </tr> <tr> <td>0.4.0</td> <td><ul> <li>Fixed issue <a href="https://github.com/exceljs/exceljs/issues/278">Boolean cell with value ="true" is returned as 1 #278</a>. The fix involved adding two new Call Value types:<ul> <li><a href="#boolean-value">Boolean Value</a></li> <li><a href="#error-value">Error Value</a></li> </ul>Note: Minor version has been bumped up to 4 as this release introduces a couple of interface changes:<ul> <li>Boolean cells previously will have returned 1 or 0 will now return true or false</li> <li>Error cells that previously returned a string value will now return an error structure</li> </ul> </li> <li>Fixed issue <a href="https://github.com/exceljs/exceljs/issues/280">Code correctness - setters don't return a value #280</a>.</li> <li>Addressed issue <a href="https://github.com/exceljs/exceljs/issues/288">v0.3.1 breaks meteor build #288</a>.</li> </ul></td> </tr> <tr> <td>0.4.1</td> <td><ul> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/285">Add support for cp:contentStatus #285</a>. Thanks to <a href="https://github.com/holm">holm</a> for the contribution.</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/286">Fix Valid characters in XML (allow \n and \r when saving) #286</a>. Thanks to <a href="https://github.com/Rycochet">Rycochet</a> for the contribution.</li> <li>Fixed <a href="https://github.com/exceljs/exceljs/issues/275">hyperlink with query arguments corrupts workbook #275</a>. The hyperlink target is not escaped before serialising in the xml.</li> </ul></td> </tr> <tr> <td>0.4.2</td> <td><ul><li> <p>Addressed the following issues:</p> <ul> <li><a href="https://github.com/exceljs/exceljs/issues/290">White text and borders being changed to black #290</a></li> <li><a href="https://github.com/exceljs/exceljs/issues/261">Losing formatting/pivot table from loaded file #261</a></li> <li><a href="https://github.com/exceljs/exceljs/issues/272">Solid fill become black #272</a></li> </ul>These issues are potentially caused by a bug that caused colours with zero themes, tints or indexes to be rendered and parsed incorrectly.<p>Regarding themes: the theme files stored inside the xlsx container hold important information regarding colours, styles etc and if the theme information from a loaded xlsx file is lost, the results can be unpredictable and undesirable. To address this, when an ExcelJS Workbook parses an XLSX file, it will preserve any theme files it finds and include them when writing to a new XLSX. If this behaviour is not desired, the Workbook class exposes a clearThemes() function which will drop the theme content. Note that this behaviour is only implemented in the document based Workbook class, not the streamed Reader and Writer.</p> </li></ul></td> </tr> <tr> <td>0.4.3</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/294">Support error references in cell ranges #294</a>. Thanks to <a href="https://github.com/holm">holm</a> for the contribution.</li></ul></td> </tr> <tr> <td>0.4.4</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/297">Issue with copied cells #297</a>. This merge adds support for shared formulas. Thanks to <a href="https://github.com/muscapades">muscapades</a> for the contribution.</li></ul></td> </tr> <tr> <td>0.4.6</td> <td><ul> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/304">Correct spelling #304</a>. Thanks to <a href="https://github.com/toanalien">toanalien</a> for the contribution.</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/304">Added support for auto filters #306</a>. This adds <a href="#auto-filters">Auto Filters</a> to the Worksheet. Thanks to <a href="https://github.com/C4rmond4i">C4rmond4i</a> for the contribution.</li> <li>Restored NodeJS 4.0.0 compatability by removing the destructuring code. My apologies for any inconvenience.</li> </ul></td> </tr> <tr> <td>0.4.9</td> <td><ul> <li>Switching to transpiled code for distribution. This will ensure compatability with 4.0.0 and above from here on. And it will also allow use of much more expressive JS code in the lib folder!</li> <li> <a href="#images">Basic Image Support!</a>Images can now be added to worksheets either as a tiled background or stretched over a range. Note: other features like rotation, etc. are not supported yet and will reqeuire further work.</li> </ul></td> </tr> <tr> <td>0.4.10</td> <td><ul> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/319">Add missing Office Rels #319</a>. Thanks goes to <a href="https://github.com/mauriciovillalobos">mauriciovillalobos</a> for the contribution.</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/320">Add printTitlesRow Support #320</a> Thanks goes to <a href="https://github.com/psellers89">psellers89</a> for the contribution.</li> </ul></td> </tr> <tr> <td>0.4.11</td> <td><ul> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/327">Avoid error on anchor with no media #327</a>. Thanks goes to <a href="https://github.com/holm">holm</a> for the contribution.</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/332">Assortment of fixes for streaming read #332</a>. Thanks goes to <a href="https://github.com/holm">holm</a> for the contribution.</li> </ul></td> </tr> <tr> <td>0.4.12</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/334">Don’t set address if hyperlink r:id is undefined #334</a>. Thanks goes to <a href="https://github.com/holm">holm</a> for the contribution.</li></ul></td> </tr> <tr> <td>0.4.13</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/343">Issue 296 #343</a>. This fixes <a href="https://github.com/exceljs/exceljs/issues/296">Issue with writing newlines #296</a>. Thanks goes to <a href="https://github.com/holly-weisser">holly-weisser</a> for the contribution.</li></ul></td> </tr> <tr> <td>0.4.14</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/350">Syntax highlighting added ✨ #350</a>. Thanks goes to <a href="https://github.com/rmariuzzo">rmariuzzo</a> for the contribution.</li></ul></td> </tr> <tr> <td>0.5.0</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/356">Fix right to left issues #356</a>. Fixes <a href="https://github.com/exceljs/exceljs/issues/72">Add option to RTL file #72</a> and <a href="https://github.com/exceljs/exceljs/issues/126">Adding an option to set RTL worksheet #126</a>. Big thank you to <a href="https://github.com/alitaheri">alitaheri</a> for this contribution.</li></ul></td> </tr> <tr> <td>0.5.1</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/364">Fix #345 TypeError: Cannot read property 'date1904' of undefined #364</a>. This fixes <a href="https://github.com/exceljs/exceljs/issues/345">TypeError: Cannot read property 'date1904' of undefined #345</a>. Thanks to <a href="https://github.com/Diluka">Diluka</a> for this contribution.</li></ul></td> </tr> <tr> <td>0.6.0</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/389">Add rowBreaks feature. #389</a>. Thanks to <a href="https://github.com/brucejo75">brucejo75</a> for this contribution.</li></ul></td> </tr> <tr> <td>0.6.1</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/403">Guard null model fields - fix and tests #403</a>. Thanks to <a href="https://github.com/shdd-cjharries">thecjharries</a> for this contribution. Also thanks to <a href="https://github.com/Rycochet">Ryc O'Chet</a> for help with reviewing.</li></ul></td> </tr> <tr> <td>0.6.2</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/396">Add some comments in readme according csv importing #396</a>. Thanks to <a href="https://github.com/Imperat">Michael Lelyakin</a> for this contribution. Also thanks to <a href="https://github.com/planemar">planemar</a> for help with reviewing. This also closes <a href="https://github.com/exceljs/exceljs/issues/395">csv to stream doesn't work #395</a>.</li></ul></td> </tr> <tr> <td>0.7.0</td> <td><ul><li>Merged <a href="https://github.com/exceljs/exceljs/pull/407">Impl <xdr:twoCellAnchor editAs=oneCell> #407</a>. Thanks to <a href="https://github.com/Ockejanssen">Ocke Janssen</a> and <a href="https://github.com/kay-ramme">Kay Ramme</a> for this contribution. This change allows control on how images are anchored to cells.</li></ul></td> </tr> <tr> <td>0.7.1</td> <td><ul> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/423">Don't break when attempting to import a zip file that's not an Excel file (eg. .numbers) #423</a>. Thanks to <a href="https://github.com/papandreou">Andreas Lind</a> for this contribution. This change makes exceljs more reslilient when opening non-excel files.</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/434">Fixes #419 : Updates readme. #434</a>. Thanks to <a href="https://github.com/getsomecoke">Vishnu Kyatannawar</a> for this contribution.</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/436">Don't break when docProps/core.xml contains a <cp:version> tag #436</a>. Thanks to <a href="https://github.com/papandreou">Andreas Lind</a> for this contribution. This change handles core.xml files with empty version tags.</li> </ul></td> </tr> <tr> <td>0.8.0</td> <td><ul> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/442">Add Base64 Image support for the .addImage() method #442</a>. Thanks to <a href="https://github.com/jwmann">James W Mann</a> for this contribution.</li> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/453">update moment to 2.19.3 #453</a>. Thanks to <a href="https://github.com/cooltoast">Markan Patel</a> for this contribution.</li> </ul></td> </tr> <tr> <td>0.8.1</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/457">Additional information about font family property #457</a>. Thanks to <a href="https://github.com/kayakyakr">kayakyakr</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/459">Fixes #458 #459</a>. This fixes <a href="https://github.com/exceljs/exceljs/issues/458">Add style to column causes it to be hidden #458</a>. Thanks to <a href="https://github.com/AJamesPhillips">Alexander James Phillips</a> for this contribution. </li> </ul></td> </tr> <tr> <td>0.8.2</td> <td><ul> <li>Merged <a href="https://github.com/exceljs/exceljs/pull/466">Don't break when loading an Excel file containing a chartsheet #466</a>. Thanks to <a href="https://github.com/papandreou">Andreas Lind</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/471">Hotfix/sheet order#257 #471</a>. This fixes <a href="https://github.com/exceljs/exceljs/issues/257">Sheet Order #257</a>. Thanks to <a href="https://github.com/robbi">Robbi</a> for this contribution. </li> </ul></td> </tr> <tr> <td>0.8.3</td> <td><ul> <li> Assimilated <a href="https://github.com/exceljs/exceljs/pull/463">fix #79 outdated dependencies in unzip2</a>. Thanks to <a href="https://github.com/jsamr">Jules Sam. Randolph</a> for starting this fix and a really big thanks to <a href="https://github.com/kachkaev">Alexander Kachkaev</a> for finding the final solution. </li> </ul></td> </tr> <tr> <td>0.8.4</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/479">Round Excel date to nearest millisecond when converting to javascript date #479</a>. Thanks to <a href="https://github.com/bjet007">Benoit Jean</a> for this contribution. </li> </ul></td> </tr> <tr> <td>0.8.5</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/485">Bug fix: wb.worksheets/wb.eachSheet caused getWorksheet(0) to return sheet #485</a>. Thanks to <a href="https://github.com/mah110020">mah110020</a> for this contribution. </li> </ul></td> </tr> <tr> <td>0.9.0</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/489">Feature/issue 424 #489</a>. This fixes <a href="https://github.com/exceljs/exceljs/issues/424">No way to control summaryBelow or summaryRight #424</a>. Many thanks to <a href="https://github.com/sarahdmsi">Sarah</a> for this contribution. </li> </ul></td> </tr> <tr> <td>0.9.1</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/490">add type definition #490</a>. This adds type definitions to ExcelJS! Many thanks to <a href="https://github.com/taoqf">taoqf</a> for this contribution. </li> </ul></td> </tr> <tr> <td>1.0.0</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/494">Add Node 8 and Node 9 to continuous integration testing #494</a>. Many thanks to <a href="https://github.com/cooltoast">Markan Patel</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/508">Small README fix #508</a>. Many thanks to <a href="https://github.com/lbguilherme">Guilherme Bernal</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/501">Add support for inlineStr, including rich text #501</a>. Many thanks to <a href="https://github.com/linguamatics-pdenes">linguamatics-pdenes</a> and <a href="https://github.com/robscotts4rb">Rob Scott</a> for their efforts towards this contribution. Since this change is technically a breaking change (the rendered XML for inline strings will change) I'm making this a major release! </li> </ul></td> </tr> <tr> <td>1.0.1</td> <td><ul> <li> Fixed <a href="https://github.com/exceljs/exceljs/issues/520">spliceColumns problem when the number of columns are important #520</a>. </li> </ul></td> </tr> <tr> <td>1.0.2</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/524">Loosen exceljs's dependency requirements for moment #524</a>. Many thanks to <a href="https://github.com/nicoladefranceschi">nicoladefranceschi</a> for this contribution. This change addresses <a href="https://github.com/exceljs/exceljs/issues/517">Ability to use external "moment" package #517</a>. </li> </ul></td> </tr> <tr> <td>1.1.0</td> <td><ul> <li> Addressed <a href="https://github.com/exceljs/exceljs/issues/514">Is there a way inserting values in columns. #514</a>. Added a new getter/setter property to Column to get and set column values (see <a href="#columns">Columns</a> for details). </li> </ul></td> </tr> <tr> <td>1.1.1</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/532">Include index.d.ts in published packages #532</a>. To fix <a href="https://github.com/exceljs/exceljs/issues/525">TypeScript definitions missing from npm package #525</a>. Many thanks to <a href="https://github.com/saschanaz">Kagami Sascha Rosylight</a> for this contribution. </li> </ul></td> </tr> <tr> <td>1.1.2</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/536">Don't break when docProps/core.xml contains <cp:contentType /> #536</a>. Many thanks to <a href="https://github.com/papandreou">Andreas Lind</a> (and reviewers) for this contribution. </li> </ul></td> </tr> <tr> <td>1.1.3</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/537">Try to handle the case where a <c> element is missing an r attribute #537</a>. Many thanks to <a href="https://github.com/papandreou">Andreas Lind</a> for this contribution. </li> </ul></td> </tr> <tr> <td>1.2.0</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/544">Add dateUTC flag to CSV Writing #544</a>. Many thanks to <a href="https://github.com/zgriesinger">Zackery Griesinger</a> for this contribution. </li> </ul></td> </tr> <tr> <td>1.2.1</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/547">worksheet name is writable #547</a>. Many thanks to <a href="https://github.com/f111fei">xzper</a> for this contribution. </li> </ul></td> </tr> <tr> <td>1.3.0</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/549">Add CSV write buffer support #549</a>. Many thanks to <a href="https://github.com/jloveridge">Jarom Loveridge</a> for this contribution. </li> </ul></td> </tr> <tr> <td>1.4.2</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/541">Discussion: Customizable row/cell limit #541</a>. Many thanks to <a href="https://github.com/papandreou">Andreas Lind</a> for this contribution. </li> </ul></td> </tr> <tr> <td>1.4.3</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/552">Get the right text out of hyperlinked formula cells #552</a>. Many thanks to <a href="https://github.com/papandreou">Andreas Lind</a> and <a href="https://github.com/holm">Christian Holm</a> for this contribution. </li> </ul></td> </tr> <tr> <td>1.4.5</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/556">Add test case with a huge file #556</a>. Many thanks to <a href="https://github.com/papandreou">Andreas Lind</a> and <a href="https://github.com/holm">Christian Holm</a> for this contribution. </li> </ul></td> </tr> <tr> <td>1.4.6</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/557">Update README.md to reflect correct functionality of row.addPageBreak() #557</a>. Many thanks to <a href="https://github.com/raj7desai">RajDesai</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/558">fix index.d.ts #558</a>. Many thanks to <a href="https://github.com/Diluka">Diluka</a> for this contribution. </li> </ul></td> </tr> <tr> <td>1.4.7</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/562">List /xl/sharedStrings.xml in [Content_Types].xml only if one of the … #562</a>. Many thanks to <a href="https://github.com/priidikvaikla">Priidik Vaikla</a> for this contribution. </li> </ul></td> </tr> <tr> <td>1.4.8</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/562">List /xl/sharedStrings.xml in [Content_Types].xml only if one of the … #562</a>. Many thanks to <a href="https://github.com/priidikvaikla">Priidik Vaikla</a> for this contribution. </li> <li> Fixed issue with above where shared strings were used but the content type was not added. </li> </ul></td> </tr> <tr> <td>1.4.9</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/562">List /xl/sharedStrings.xml in [Content_Types].xml only if one of the … #562</a>. Many thanks to <a href="https://github.com/priidikvaikla">Priidik Vaikla</a> for this contribution. </li> <li> Fixed issue with above where shared strings were used but the content type was not added. </li> <li> Fixed issue <a href="https://github.com/exceljs/exceljs/issues/581">1.4.8 broke writing Excel files with useSharedStrings:true #581</a>. </li> </ul></td> </tr> <tr> <td>1.4.10</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/564">core-xform: Tolerate a missing cp: namespace for the coreProperties element #564</a>. Many thanks to <a href="https://github.com/papandreou">Andreas Lind</a> for this contribution. </li> </ul></td> </tr> <tr> <td>1.4.12</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/567">Avoid error on malformed address #567</a>. Many thanks to <a href="https://github.com/papandreou">Andreas Lind</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/571">Added a missing Promise<void> in index.d.ts #571</a>. Many thanks to <a href="https://github.com/carboneater">Gabriel Fournier</a> for this contribution. This release should fix <a href="https://github.com/exceljs/exceljs/issues/548">Is workbook.commit() still a promise or not #548</a> </li> </ul></td> </tr> <tr> <td>1.4.13</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/574">Issue #488 #574</a>. Many thanks to <a href="https://github.com/dljenkins">dljenkins</a> for this contribution. This release should fix <a href="https://github.com/exceljs/exceljs/issues/488">Invalid time value Exception #488</a>. </li> </ul></td> </tr> <tr> <td>1.5.0</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/577">Sheet add state for hidden or show #577</a>. Many thanks to <a href="https://github.com/Hsinfu">Freddie Hsinfu Huang</a> for this contribution. This release should fix <a href="https://github.com/exceljs/exceljs/issues/226">hide worksheet and reorder sheets #226</a>. </li> </ul></td> </tr> <tr> <td>1.5.1</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/582">Update index.d.ts #582</a>. Many thanks to <a href="https://github.com/hankolsen">hankolsen</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/584">Decode the <em>x<4 hex chars></em> escape notation in shared strings #584</a>. Many thanks to <a href="https://github.com/papandreou">Andreas Lind</a> for this contribution. </li> </ul></td> </tr> <tr> <td>1.6.0</td> <td><ul> <li> Added .html property to Cells to facilitate html-safe rendering. See <a href="#handling-individual-cells">Handling Individual Cells</a> for details. </li> </ul></td> </tr> <tr> <td>1.6.1</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/587">Fix Issue #488 where dt is an invalid date format. #587</a> to fix <a href="https://github.com/exceljs/exceljs/issues/488">Invalid time value Exception #488</a>. Many thanks to <a href="https://github.com/ilijaz">Iliya Zubakin</a> for this contribution. </li> </ul></td> </tr> <tr> <td>1.6.2</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/587">Fix Issue #488 where dt is an invalid date format. #587</a> to fix <a href="https://github.com/exceljs/exceljs/issues/488">Invalid time value Exception #488</a>. Many thanks to <a href="https://github.com/ilijaz">Iliya Zubakin</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/590">drawing element must be below rowBreaks according to spec or corrupt worksheet #590</a> Many thanks to <a href="https://github.com/nevace">Liam Neville</a> for this contribution. </li> </ul></td> </tr> <tr> <td>1.6.3</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/595">set type optional #595</a> Many thanks to <a href="https://github.com/taoqf">taoqf</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/578">Fix some xlsx stream read xlsx not in guaranteed order problem #578</a> Many thanks to <a href="https://github.com/KMethod">KMethod</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/599">Fix formatting issue in README #599</a> Many thanks to <a href="https://github.com/getsomecoke">Vishnu Kyatannawar</a> for this contribution. </li> </ul></td> </tr> <tr> <td>1.7.0</td> <td><ul> <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">Kuznetsov Aleksey</a> for this contribution. </li> </ul></td> </tr> <tr> <td>1.8.0</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/636">Fix misinterpreted ranges from <definedName> #636</a> Many thanks to <a href="https://github.com/papandreou">Andreas Lind</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/640">Add LGTM code quality badges #640</a> Many thanks to <a href="https://github.com/xcorail">Xavier RENE-CORAIL</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/646">Add type definition for Column.values #646</a> Many thanks to <a href="https://github.com/emlai">Emil Laine</a> for this contribution. This fixes <a href="https://github.com/exceljs/exceljs/issues/645">Column.values is missing TypeScript definitions #645</a>. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/663">Update README.md with load() option #663</a> Many thanks to <a href="https://github.com/thinksentient">Joanna Walker</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/677">fixed packages according to npm audit #677</a> Many thanks to <a href="https://github.com/misleadingTitle">Manuel Minuti</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/699">Update index.d.ts #699</a> Many thanks to <a href="https://github.com/rayyen">Ray Yen</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/708">Replaced node-unzip-2 to unzipper package which is more robust #708</a> Many thanks to <a href="https://github.com/johnmalkovich100">johnmalkovich100</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/728">Read worksheet hidden state #728</a> Many thanks to <a href="https://github.com/LesterLyu">Dishu(Lester) Lyu</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/736">add Worksheet.state typescript definition fix #714 #736</a> Many thanks to <a href="https://github.com/ilyes-kechidi">Ilyes Kechidi</a> for this contribution. This fixes <a href="https://github.com/exceljs/exceljs/issues/714">Worksheet State does not exist in index.d.ts #714</a>. </li> </ul></td> </tr> <tr> <td>1.9.0</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/702">Improvements for images (correct reading/writing possitions) #702</a>. This fixes <a href="https://github.com/exceljs/exceljs/issues/650">Image location don't respect Column width #650</a> and <a href="https://github.com/exceljs/exceljs/issues/467">Image position - stretching image #467</a>. Many thanks to <a href="https://github.com/Siemienik">Siemienik Paweł</a> for this contribution. </li> </ul></td> </tr> <tr> <td>1.9.1</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/619">Add Typescript support for formulas without results #619</a>. Many thanks to <a href="https://github.com/Wolfchin">Loursin</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/737">Fix existing row styles when using spliceRows #737</a>. Many thanks to <a href="https://github.com/cxam">cxam</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/774">Consistent code quality #774</a>. Many thanks to <a href="https://github.com/alubbe">Andreas Lubbe</a> for this contribution. </li> </ul></td> </tr> <tr> <td>1.10.0</td> <td><ul> <li> Fixed effect of splicing rows and columns on defined names </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/746">Add support for adding images anchored to one cell #746</a>. Many thanks to <a href="https://github.com/karlvr">Karl von Randow</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/758">Add vertical align property #758</a>. Many thanks to <a href="https://github.com/MikeZyatkov">MikeZyatkov</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/775">Replace the temp lib to tmp #775</a>. Many thanks to <a href="https://github.com/coldhiber">Ivan Sotnikov</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/780">Replace the temp lib to tmp #775</a>. Many thanks to <a href="https://github.com/alubbe">Andreas Lubbe</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/793">Update Worksheet.dimensions return type #793</a>. Many thanks to <a href="https://github.com/Siemienik">Siemienik Paweł</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/795">One more types fix #795</a>. Many thanks to <a href="https://github.com/Siemienik">Siemienik Paweł</a> for this contribution. </li> </ul></td> </tr> <tr> <td>1.11.0</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/776">Add the ability to bail out of parsing if the number of columns exceeds a given limit #776</a>. Many thanks to <a href="https://github.com/papandreou">Andreas Lind</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/799">Add support for repeated columns on every page when printing. #799</a>. Many thanks to <a href="https://github.com/FreakenK">Jasmin Auger</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/815">Do not use a promise polyfill on modern setups #815</a>. Many thanks to <a href="https://github.com/alubbe">Andreas Lubbe</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/807">copy LICENSE to the dist folder #807</a>. Many thanks to <a href="https://github.com/zypA13510">Yuping Zuo</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/813">Avoid unhandled rejection on XML parse error #813</a>. Many thanks to <a href="https://github.com/papandreou">Andreas Lind</a> for this contribution. </li> </ul></td> </tr> <tr> <td>1.12.0</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/819">(chore) increment unzipper to 0.9.12 to address npm advisory 886 #819</a>. Many thanks to <a href="https://github.com/kreig303">Kreig Zimmerman</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/817">docs(README): improve docs #817</a>. Many thanks to <a href="https://github.com/zypA13510">Yuping Zuo</a> for this contribution. </li> <li> <p> Merged <a href="https://github.com/exceljs/exceljs/pull/823">add comment support #529 #823</a>. Many thanks to <a href="https://github.com/ilimei">ilimei</a> for this contribution. </p> <p>This fixes the following issues:</p> <ul> <li><a href="https://github.com/exceljs/exceljs/issues/202">Is it possible to add comment on a cell? #202</a></li> <li><a href="https://github.com/exceljs/exceljs/issues/451">Add comment to cell #451</a></li> <li><a href="https://github.com/exceljs/exceljs/issues/503">Excel add comment on cell #503</a></li> <li><a href="https://github.com/exceljs/exceljs/issues/529">How to add Cell comment #529</a></li> <li><a href="https://github.com/exceljs/exceljs/issues/707">Please add example to how I can insert comments for a cell #707</a></li> </ul> </li> </ul></td> </tr> <tr> <td>1.12.1</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/822">fix issue with print area defined name corrupting file #822</a>. Many thanks to <a href="https://github.com/donaldsonjulia">Julia Donaldson</a> for this contribution. This fixes issue <a href="https://github.com/exceljs/exceljs/issues/664">Defined Names Break/Corrupt Excel File into Repair Mode #664</a>. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/831">Only keep at most 31 characters for sheetname #831</a>. Many thanks to <a href="https://github.com/kaleo211">Xuebin He</a> for this contribution. This fixes issue <a href="https://github.com/exceljs/exceljs/issues/398">Limit worksheet name length to 31 characters #398</a>. </li> </ul></td> </tr> <tr> <td>1.12.2</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/834">add cn doc #834</a> and <a href="https://github.com/exceljs/exceljs/pull/852">update cn doc #852</a>. Many thanks to <a href="https://github.com/loverto">flydragon</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/853">fix minor spelling mistake in readme #853</a>. Many thanks to <a href="https://github.com/ridespirals">John Varga</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/855">Fix defaultRowHeight not working #855</a>. Many thanks to <a href="https://github.com/autukill">autukill</a> for this contribution. This should fix <a href="https://github.com/exceljs/exceljs/issues/422">row height doesn't apply to row #422</a>, <a href="https://github.com/exceljs/exceljs/issues/634">The worksheet.properties.defaultRowHeight can't work!! How to set the rows height, help!! #634</a> and <a href="https://github.com/exceljs/exceljs/issues/696">Default row height doesn't work ? #696</a>. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/854">Always keep first font #854</a>. Many thanks to <a href="https://github.com/dogusev">Dmitriy Gusev</a> for this contribution. This should fix <a href="https://github.com/exceljs/exceljs/issues/816">document scale (width only) is different after read & write #816</a>, <a href="https://github.com/exceljs/exceljs/issues/833">Default font from source document can not be parsed. #833</a> and <a href="https://github.com/exceljs/exceljs/issues/849">Wrong base font: hardcoded Calibri instead of font from the document #849</a>. </li> </ul></td> </tr> <tr> <td>1.13.0</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/862">zip: allow tuning compression for performance or size #862</a>. Many thanks to <a href="https://github.com/myfreeer">myfreeer</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/863">Feat configure headers and footers #863</a>. Many thanks to <a href="https://github.com/autukill">autukill</a> for this contribution. </li> <li> Fixed an issue with defaultRowHeight where the default value resulted in 'customHeight' property being set. </li> </ul></td> </tr> <tr> <td>1.14.0</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/874">Fix header and footer text format error in README.md #874</a>. Many thanks to <a href="https://github.com/autukill">autukill</a> for this contribution. </li> <li> Added Tables. See <a href="#tables">Tables</a> for details. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/887">fix: #877 and #880</a>. Many thanks to <a href="https://github.com/aexei">Alexander Heinrich</a> for this contribution. This fixes <a href="https://github.com/exceljs/exceljs/pull/877">bug: Hyperlink without text crashes write #877</a> and <a href="https://github.com/exceljs/exceljs/pull/880">bug: malformed comment crashes on write #880</a> </li> </ul></td> </tr> <tr> <td>1.15.0</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/889">Add Compression level option to WorkbookWriterOptions for streaming #889</a>. Many thanks to <a href="https://github.com/ABenassi87">Alfredo Benassi</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/903">Feature/Cell Protection #903</a> and <a href="https://github.com/exceljs/exceljs/pull/907">Feature/Sheet Protection #907</a>. Many thanks to <a href="https://github.com/karabaesh">karabaesh</a> for these contributions. </li> </ul></td> </tr> <tr> <td>2.0.1</td> <td> <div class="markdown-heading"><h2 class="heading-element">Major Version Change</h2><a id="user-content-major-version-change" class="anchor" aria-label="Permalink: Major Version Change" href="#major-version-change"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Introducing async/await to ExcelJS!</p> <p>The new async and await features of JavaScript can help a lot to make code more readable and maintainable. To avoid confusion, particularly with returned promises from async functions, we have had to remove the Promise class configuration option and from v2 onwards ExcelJS will use native Promises. Since this is potentially a breaking change we're bumping the major version for this release.</p> <div class="markdown-heading"><h2 class="heading-element">Changes</h2><a id="user-content-changes" class="anchor" aria-label="Permalink: Changes" href="#changes"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/829">Introduce async/await #829</a>. Many thanks to <a href="https://github.com/alubbe">Andreas Lubbe</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/930">Update index.d.ts #930</a>. Many thanks to <a href="https://github.com/cosmonovallc">cosmonovallc</a> for this contributions. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/940">TS: Add types for addTable function #940</a>. Many thanks to <a href="https://github.com/egmen">egmen</a> for this contributions. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/926">added explicit return types to the type definitions of Worksheet.protect() and Worksheet.unprotect() #926</a>. Many thanks to <a href="https://github.com/drjokepu">Tamas Czinege</a> for this contributions. </li> <li> Dropped dependencies on Promise libraries. </li> </ul> </td> </tr> <tr> <td>3.0.0</td> <td> <div class="markdown-heading"><h2 class="heading-element">Another Major Version Change</h2><a id="user-content-another-major-version-change" class="anchor" aria-label="Permalink: Another Major Version Change" href="#another-major-version-change"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Javascript has changed a lot over the years, and so have the modules and technologies surrounding it. To this end, this major version of ExcelJS changes the structure of the publish artefacts:</p> <div class="markdown-heading"><h3 class="heading-element">Main Export is now the Original Javascript Source</h3><a id="user-content-main-export-is-now-the-original-javascript-source" class="anchor" aria-label="Permalink: Main Export is now the Original Javascript Source" href="#main-export-is-now-the-original-javascript-source"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>Prior to this release, the transpiled ES5 code was exported as the package main. From now on, the package main comes directly from the lib/ folder. This means a number of dependencies have been removed, including the polyfills.</p> <div class="markdown-heading"><h3 class="heading-element">ES5 and Browserify are Still Included</h3><a id="user-content-es5-and-browserify-are-still-included" class="anchor" aria-label="Permalink: ES5 and Browserify are Still Included" href="#es5-and-browserify-are-still-included"><span aria-hidden="true" class="octicon octicon-link"></span></a></div> <p>In order to support those that still require ES5 ready code (e.g. as dependencies in web apps) the source code will still be transpiled and available in dist/es5.</p> <p>The ES5 code is also browserified and available as dist/exceljs.js or dist/exceljs.min.js</p> <p><i>See the section <a href="#importing">Importing</a> for details</i></p> </td> </tr> <tr> <td>3.1.0</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/873">Uprev fast-csv to latest version which does not use unsafe eval #873</a>. Many thanks to <a href="https://github.com/miketownsend">Mike Townsend</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/906">Exclude Infinity on createInputStream #906</a>. Many thanks to <a href="https://github.com/sophiedophie">Sophie Kwon</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/911">Feature/Add comments/notes to stream writer #911</a>. Many thanks to <a href="https://github.com/brunoargolo">brunoargolo</a> for this contribution. This fixes <a href="https://github.com/exceljs/exceljs/issues/868">Can't add cell comment using streaming WorkbookWriter #868</a> </li> <li> Fixed an issue with reading .xlsx files containing notes. This should resolve the following issues: <ul> <li><a href="https://github.com/exceljs/exceljs/issues/941">Reading comment/note from xlsx #941</a></li> <li><a href="https://github.com/exceljs/exceljs/issues/944">Excel.js doesn't parse comments/notes. #944</a></li> </ul> </li> </ul></td> </tr> <tr> <td>3.2.0</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/923">Add document for zip options of streaming WorkbookWriter #923</a>. Many thanks to <a href="https://github.com/piglovesyou">Soichi Takamura</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/933">array formula #933</a>. Many thanks to <a href="https://github.com/yoann-antoviaque">yoann-antoviaque</a> for this contribution. This fixes <a href="https://github.com/exceljs/exceljs/issues/932">broken array formula #932</a> and adds <a href="#array-formula">Array Formulae</a> to ExcelJS. </li> </ul></td> </tr> <tr> <td>3.3.0</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/892">Fix anchor.js #892</a>. Many thanks to <a href="https://github.com/wwojtkowski">Wojciech Wojtkowski</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/896">add xml:space="preserve" for all whitespaces #896</a>. Many thanks to <a href="https://github.com/sebikeller">Sebastian Keller</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/959">Add <code>shrinkToFit</code> to document and typing #959</a>. Many thanks to <a href="https://github.com/mozisan">('3')</a> for this contribution. This fixes <a href="https://github.com/exceljs/exceljs/issues/943">shrinkToFit property not on documentation #943</a>. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/980">#951: Force formula re-calculation on file open from Excel #980</a>. Many thanks to <a href="https://github.com/zymon">zymon</a> for this contribution. This fixes <a href="https://github.com/exceljs/exceljs/issues/951">Force formula re-calculation on file open from Excel #951</a>. </li> <li> Fixed <a href="https://github.com/exceljs/exceljs/issues/989">Lib contains class syntax, not compatible with IE11 #989</a>. </li> </ul></td> </tr> <tr> <td>3.3.1</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1000">Add headerFooter to worksheet model when importing from file #1000</a>. Many thanks to <a href="https://github.com/kigh-ota">Kaiichiro Ota</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1005">Update eslint plugins and configs #1005</a>, <a href="https://github.com/exceljs/exceljs/pull/1006">Drop grunt-lib-phantomjs #1006</a> and <a href="https://github.com/exceljs/exceljs/pull/1007">Rename .browserslintrc.txt to .browserslistrc #1007</a>. Many thanks to <a href="https://github.com/takenspc">Takeshi Kurosawa</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1012">Fix issue #988 #1012</a>. This fixes <a href="https://github.com/exceljs/exceljs/issues/988">Can not read excel file #988</a>. Many thanks to <a href="https://github.com/thambley">Todd Hambley</a> for this contribution. </li> </ul></td> </tr> <tr> <td>3.4.0</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1016">Feature/stream writer add background images #1016</a>. Many thanks to <a href="https://github.com/brunoargolo">brunoargolo</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1019">Fix issue # 991 #1019</a>. This fixes <a href="https://github.com/exceljs/exceljs/issues/991">read csv file issue #991</a>. Many thanks to <a href="https://github.com/LibertyNJ">Nathaniel J. Liberty</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1018">Large excels - optimize performance of writing file by excelJS + optimize generated file (MS excel opens it much faster) #1018</a>. Many thanks to <a href="https://github.com/pzawadzki82">Piotr</a> for this contribution. </li> </ul></td> </tr> <tr> <td>3.5.0</td> <td><ul> <li> <a href="#conditional-formatting">Conditional Formatting</a> A subset of Excel Conditional formatting has been implemented! Specifically the formatting rules that do not require XML to be rendered inside an <extLst> node, or in other words everything except databar and three icon sets (3Triangles, 3Stars, 5Boxes). These will be implemented in due course </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1030">remove core-js/ import #1030</a>. Many thanks to <a href="https://github.com/bleuscyther">jeffrey n. carre</a> for this contribution. This change is used to create a new browserified bundle artefact that does not include any polyfills. See <a href="#browserify">Browserify</a> for details. </li> </ul></td> </tr> <tr> <td>3.6.0</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1042">1041 multiple print areas #1042</a>. Many thanks to <a href="https://github.com/AlexanderPruss">Alexander Pruss</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1058">fix typings for cell.note #1058</a>. Many thanks to <a href="https://github.com/xydens">xydens</a> for this contribution. </li> <li> <a href="#conditional-formatting">Conditional Formatting</a> has been completed. The <extLst> conditional formattings including dataBar and the three iconSet types (3Triangles, 3Stars, 5Boxes) are now available. </li> </ul></td> </tr> <tr> <td>3.6.1</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1047">Clarify merging cells by row/column numbers #1047</a>. Many thanks to <a href="https://github.com/kendallroth">Kendall Roth</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1048">Fix README mistakes concerning freezing views #1048</a>. Many thanks to <a href="https://github.com/overlookmotel">overlookmotel</a> for this contribution. </li> <li> Merged: <ul> <li><a href="https://github.com/exceljs/exceljs/pull/1073">fix issue #1045 horizontalCentered & verticalCentered in page not working #1073</a></li> <li><a href="https://github.com/exceljs/exceljs/pull/1082">Fix the problem of anchor failure of readme_zh.md file #1082</a></li> <li><a href="https://github.com/exceljs/exceljs/pull/1065">Fix problems caused by case of worksheet names #1065</a></li> </ul> Many thanks to <a href="https://github.com/Alanscut">Alan Wang</a> for this contribution. </li> </ul></td> </tr> <tr> <td>3.7.0</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1076">Fix Issue #1075: Unable to read/write defaultColWidth attribute in <sheetFormatPr> node #1076</a>. Many thanks to <a href="https://github.com/kigh-ota">Kaiichiro Ota</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1078">function duplicateRows added #1078</a> and <a href="https://github.com/exceljs/exceljs/pull/1088">Duplicate rows #1088</a>. Many thanks to <a href="https://github.com/cbeltrangomez84">cbeltrangomez84</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1087">Prevent from unhandled promise rejection durning workbook load #1087</a>. Many thanks to <a href="https://github.com/sohai">Wojtek</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1071">fix issue #899 Support for inserting pictures with hyperlinks #1071</a>. Many thanks to <a href="https://github.com/Alanscut">Alan Wang</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1089">Update TS definition to reference proper internal libraries #1089</a>. Many thanks to <a href="https://github.com/jakawell">Jesse Kawell</a> for this contribution. </li> </ul></td> </tr> <tr> <td>3.8.0</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1090">Issue/Corrupt workbook using stream writer with background image #1090</a>. Many thanks to <a href="https://github.com/brunoargolo">brunoargolo</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1092">Fix index.d.ts #1092</a>. Many thanks to <a href="https://github.com/Siemienik">Siemienik Paweł</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1093">Wait for writing to tmp fiels before handling zip stream close #1093</a>. Many thanks to <a href="https://github.com/sohai">Wojtek</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1095">Support ArrayBuffer as an xlsx.load argument #1095</a>. Many thanks to <a href="https://github.com/sohai">Wojtek</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1099">Export shared strings with RichText #1099</a>. Many thanks to <a href="https://github.com/kigh-ota">Kaiichiro Ota</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1102">Keep borders of merged cells after rewriting an Excel workbook #1102</a>. Many thanks to <a href="https://github.com/kigh-ota">Kaiichiro Ota</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1104">Fix #1103: <code>editAs</code> not working #1104</a>. Many thanks to <a href="https://github.com/Alanscut">Alan Wang</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1105">Fix to issue #1101 #1105</a>. Many thanks to <a href="https://github.com/cbeltrangomez84">Carlos Andres Beltran Gomez</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1107">fix some errors and typos in readme #1107</a>. Many thanks to <a href="https://github.com/Alanscut">Alan Wang</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1112">Update issue templates #1112</a>. Many thanks to <a href="https://github.com/Siemienik">Siemienik Paweł</a> for this contribution. </li> </ul></td> </tr> <tr> <td>3.8.1</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1112">Update issue templates #1112</a>. Many thanks to <a href="https://github.com/Siemienik">Siemienik Paweł</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1124">Typo: Replace 'allways' with 'always' #1124</a>. Many thanks to <a href="https://github.com/Siemienik">Siemienik Paweł</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1125">Replace uglify with terser #1125</a>. Many thanks to <a href="https://github.com/alubbe">Andreas Lubbe</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1126">Apply codestyles on each commit and run lint:fix #1126</a>. Many thanks to <a href="https://github.com/alubbe">Andreas Lubbe</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1127">[WIP] Replace sax with saxes #1127</a>. Many thanks to <a href="https://github.com/alubbe">Andreas Lubbe</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1128">Add PR, Feature Request and Question github templates #1128</a>. Many thanks to <a href="https://github.com/alubbe">Andreas Lubbe</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1137">fix issue #749 Fix internal link example errors in readme #1137</a>. Many thanks to <a href="https://github.com/Alanscut">Alan Wang</a> for this contribution. </li> </ul></td> </tr> <tr> <td>3.8.2</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1133">Update @types/node version to latest lts #1133</a>. Many thanks to <a href="https://github.com/Siemienik">Siemienik Paweł</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1134">fix issue #1118 Adding Data Validation and Conditional Formatting to the same sheet causes corrupt workbook #1134</a>. Many thanks to <a href="https://github.com/Alanscut">Alan Wang</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1139">Add benchmarking #1139</a>. Many thanks to <a href="https://github.com/alubbe">Andreas Lubbe</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1148">fix issue #731 image extensions not be case sensitive #1148</a>. Many thanks to <a href="https://github.com/Alanscut">Alan Wang</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1169">fix issue #1165 and update index.d.ts #1169</a>. Many thanks to <a href="https://github.com/Alanscut">Alan Wang</a> for this contribution. </li> </ul></td> </tr> <tr> <td>3.9.0</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1140">Optimize SAXStream #1140</a>. Many thanks to <a href="https://github.com/alubbe">Andreas Lubbe</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1143">fix issue #1057 Fix addConditionalFormatting is not a function error when using Streaming XLSX Writer #1143</a>. Many thanks to <a href="https://github.com/Alanscut">Alan Wang</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1160">fix issue #204 sets default column width #1160</a>. Many thanks to <a href="https://github.com/Alanscut">Alan Wang</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1164">Include cell address for Shared Formula master must exist.. error #1164</a>. Many thanks to <a href="https://github.com/noisyscanner">Brad Reed</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1166">Typo in DataValidation examples #1166</a>. Many thanks to <a href="https://github.com/mravey">Matthieu Ravey</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1176">fixes #1175 #1176</a>. Many thanks to <a href="https://github.com/Siemienik">Siemienik Paweł</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1179">fix issue #1178 and update index.d.ts #1179</a>. Many thanks to <a href="https://github.com/Alanscut">Alan Wang</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1182">Simple test if typescript is able to compile #1182</a>. Many thanks to <a href="https://github.com/Siemienik">Siemienik Paweł</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1190">More improvements #1190</a>. Many thanks to <a href="https://github.com/alubbe">Andreas Lubbe</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1193">Ensure all node_modules are compatible with IE11 #1193</a>. Many thanks to <a href="https://github.com/alubbe">Andreas Lubbe</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1199">fix issue #1194 and update index.d.ts #1199</a>. Many thanks to <a href="https://github.com/Alanscut">Alan Wang</a> for this contribution. This fixes <a href="https://github.com/exceljs/exceljs/issues/1194">[BUG] TypeScript version doesn't have definition for Worksheet.addConditionalFormatting #1194</a>. </li> Merged <a href="https://github.com/exceljs/exceljs/pull/1204">fix issue #1157 marked Cannot set property #1204</a>. Many thanks to <a href="https://github.com/Alanscut">Alan Wang</a> for this contribution. This fixes <a href="https://github.com/exceljs/exceljs/issues/1157">[BUG] Cannot set property 'marked' of undefined #1157</a>. <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1209">Deprecate createInputStream #1209</a>. Many thanks to <a href="https://github.com/alubbe">Andreas Lubbe</a> for this contribution. </li> Merged <a href="https://github.com/exceljs/exceljs/pull/1204">fix issue #1206 #1205 Abnormality of and attributes #1210</a>. Many thanks to <a href="https://github.com/Alanscut">Alan Wang</a> for this contribution. This fixes <a href="https://github.com/exceljs/exceljs/issues/1205">[BUG] Unlocked cells do not maintain their unlocked status after reading and writing a workbook. #1205</a> and <a href="https://github.com/exceljs/exceljs/issues/1206">[BUG] Unlocked cells lose their vertical and horizontal alignment after a read and write. #1206</a>. </ul></td> </tr> <tr> <td>3.10.0</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1233">[Chore] Upgrade dependencies #1233</a>. Many thanks to <a href="https://github.com/alubbe">Andreas Lubbe</a> for this contribution. </li> Merged <a href="https://github.com/exceljs/exceljs/pull/1220">Fix issue #1198 Absolute path and relative path need to be compatible #1220</a>. Many thanks to <a href="https://github.com/Alanscut">Alan Wang</a> for this contribution. This fixes <a href="https://github.com/exceljs/exceljs/issues/1198">[BUG] Loading OpenPyXL workbooks #1198</a>. Merged <a href="https://github.com/exceljs/exceljs/pull/1234">Upgrade tmp #1234</a>. Many thanks to <a href="https://github.com/alubbe">Andreas Lubbe</a> for this contribution. This fixes <a href="https://github.com/exceljs/exceljs/issues/882">Process doesn't exit < 8.12.0 #882</a>. <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1270">New version of dayjs requires explicit <code>Z</code> in the date formats #1270</a>. Many thanks to <a href="https://github.com/alubbe">Andreas Lubbe</a> for this contribution. </li> Merged <a href="https://github.com/exceljs/exceljs/pull/1280">Fixed #1276 #1280</a>. Many thanks to <a href="https://github.com/Subhajitdas298">Subhajit Das</a> for this contribution. This fixes <a href="https://github.com/exceljs/exceljs/issues/1276">[BUG] Invalid regular expression: /^[ -퟿-�ð�€€-ô�¿¿]$/: Range out of order in character class #1276</a>. Merged <a href="https://github.com/exceljs/exceljs/pull/1278">[bugfix] Fix special cell values causing invalid files produced #1278</a>. Many thanks to <a href="https://github.com/Alanscut">Alan Wang</a> for this contribution. This fixes <a href="https://github.com/exceljs/exceljs/issues/703">Special cell value results invalid file #703</a>. <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1208">Re-translation of simplified Chinese documents (zh-cn) #1208</a>. Many thanks to <a href="https://github.com/wang1212">不如怀念</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1208">data-validations-xform: keep formulae if type not exists #1229</a>. Many thanks to <a href="https://github.com/myfreeer">myfreeer</a> for this contribution. </li> Merged <a href="https://github.com/exceljs/exceljs/pull/1257">WorkbookWriter support rowBreaks #1257</a>. Many thanks to <a href="https://github.com/Alanscut">Alan Wang</a> for this contribution. This fixes <a href="https://github.com/exceljs/exceljs/issues/1248">[BUG] WorkbookWriter doesn't support headerFooter and rowBreaks. #1248</a>. <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1289">Fixed ascii only #1289</a>. Many thanks to <a href="https://github.com/Subhajitdas298">Subhajit Das</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1159">Supports setting cell comment properties #1159</a>. Many thanks to <a href="https://github.com/Alanscut">Alan Wang</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1215">docs: add links to top with jump2header #1215</a>. Many thanks to <a href="https://github.com/strdr4605">Dragoș Străinu</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1310">Fix cell.text return an empty object when cell is empty #1310</a>. Many thanks to <a href="https://github.com/Alanscut">Alan Wang</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1303">Use rest args instead of slicing arguments #1303</a>. Many thanks to <a href="https://github.com/alubbe">Andreas Lubbe</a> for this contribution. </li> </ul></td> </tr> <tr> <td>4.0.1</td> <td><ul> <li> A Major Version Change - The main ExcelJS interface has been migrated from streams based API to Async Iterators making for much cleaner code. While technically a breaking change, most of the API is unchanged For details see <a href="https://github.com/exceljs/exceljs/blob/master/UPGRADE-4.0.md">UPGRADE-4.0.md</a>. </li> <li> This upgrade has come from the following merges: <ul> <li><a href="https://github.com/exceljs/exceljs/pull/1135">[MAJOR VERSION] Async iterators #1135</a></li> <li><a href="https://github.com/exceljs/exceljs/pull/1142">[MAJOR VERSION] Move node v8 support to ES5 imports #1142</a></li> </ul> A lot of work from the team went into this - in particular <a href="https://github.com/alubbe">Andreas Lubbe</a> and <a href="https://github.com/Siemienik">Siemienik Paweł</a>. </li> </ul></td> </tr> <tr> <td>4.1.0</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1317">Remove const enum and add ErrorValue in index.d.ts #1317</a> Many thanks to <a href="https://github.com/aplum">Alex Plumley</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1319">update README.md and READEME_zh.md #1319</a> Many thanks to <a href="https://github.com/Alanscut">Alan Wang</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1324">Added insert rows functionality with new style inherit options #1324</a> Many thanks to <a href="https://github.com/Subhajitdas298">Subhajit Das</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1327">Updated readme for insert rows #1327</a> Many thanks to <a href="https://github.com/Subhajitdas298">Subhajit Das</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1338">Fix: Async iterators definition #1338</a> Many thanks to <a href="https://github.com/JuhBoy">Julien - JuH</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1344">[bugfix] Fix special cell values causing invalid files produced(#1339) #1344</a>. This fixes <a href="https://github.com/exceljs/exceljs/pull/1339">[BUG] hasOwnProperty, constructor special words not serialized correctly with stream.xlsx.WorkbookWriter #1339</a>. Many thanks to <a href="https://github.com/Alanscut">Alan Wang</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1334">Fix the error that comment does not delete at spliceColumn #1334</a>. Many thanks to <a href="https://github.com/sdg9670">sdg9670</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1328">bug fix can not read property date1904 of undefined #1328</a>. Many thanks to <a href="https://github.com/1328">1328</a> for this contribution. </li> </ul></td> </tr> <tr> <td>4.1.1</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1356">update index.d.ts #1356</a> Many thanks to <a href="https://github.com/Siemienik">Siemienik Paweł</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1358">Fix styleOption error in index.ts #1358</a>. This fixes <a href="https://github.com/exceljs/exceljs/issues/1357">[BUG] 4.1.0 causes TypeScript compilation errors - addRows styleOption should be optional? #1357</a>. Many thanks to <a href="https://github.com/sdg9670">sdg9670</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1354">Improved documentation #1354</a> Many thanks to <a href="https://github.com/Subhajitdas298">Subhajit Das</a> for this contribution. </li> </ul></td> </tr> <tr> <td>4.2.0</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1432">Fix issue #1431 Streaming WorkbookReader _parseSharedStrings doesn't handle rich text within shared string nodes #1432</a>. Many thanks to <a href="https://github.com/rheidari">Reza Heidari</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1442">Change typing for colorScale colour to array of colours #1442</a>. Many thanks to <a href="https://github.com/7coil">Leondro Lio</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1443">AddRow/s and InsertRow/s now returning the newly added rows #1443</a>. Many thanks to <a href="https://github.com/Subhajitdas298">Subhajit Das</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1475">fix docs #1475</a>. Many thanks to <a href="https://github.com/kiba-d">Dmytro Kyba</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1360">[bugfix]Fix Issue #1254 and update index.d.ts #1360</a>. This should fix <a href="https://github.com/exceljs/exceljs/issues/1254">[BUG] getSheetValues() typescript definition is incorrect #1254</a>. Many thanks to <a href="https://github.com/Alanscut">Alan Wang</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1262">Fix issue #1261 WorkbookWriter sheet.protect() function doesn't exist #1262</a>. This should fix <a href="https://github.com/exceljs/exceljs/issues/1261">[BUG] WorkbookWriter sheet.protect() function doesn't exist #1261</a>. Many thanks to <a href="https://github.com/rheidari">Reza Heidari</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1405">README: images not supported in streaming mode #1405</a>. Many thanks to <a href="https://github.com/chdh">Christian d'Heureuse</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1477">Run linter with prettier 2 #1477</a>. Many thanks to <a href="https://github.com/alubbe">Andreas Lubbe</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1476">Increase the performance of some xml and html helpers #1476</a>. Many thanks to <a href="https://github.com/alubbe">Andreas Lubbe</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1482">Performance improvement in col-cache #1482</a>. Many thanks to <a href="https://github.com/antimatter15">Kevin Kwok</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1481">Fix type definition for DefinedNamesRanges #1481</a>. Many thanks to <a href="https://github.com/antimatter15">Kevin Kwok</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1480">Fixed undefined ref error when setting a data validation that is a range of cells at the worksheet level #1480</a>. Many thanks to <a href="https://github.com/Bene-Graham">Bene-Graham</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1485">add A3 paperSize number #1485</a>. This should fix <a href="https://github.com/exceljs/exceljs/issues/1406">[F] The printing size can be set to A3 #1406</a>. Many thanks to <a href="https://github.com/skypesky">skypesky</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1478">Fix #1364 Incorrect Worksheet Name on Streaming XLSX Reader #1478</a>. This should fix <a href="https://github.com/exceljs/exceljs/issues/1364">[BUG] Incorrect Worksheet Name on Streaming XLSX Reader #1364</a>. Many thanks to <a href="https://github.com/antimatter15">Kevin Kwok</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1466">grunt: skip babel transpile for core-js #1466</a>. Many thanks to <a href="https://github.com/myfreeer">myfreeer</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1486">xlsx: use TextDecoder and TextEncoder in browser #1486</a>. Many thanks to <a href="https://github.com/myfreeer">myfreeer</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1488">Refine typing for Column #1488</a>. This should fix <a href="https://github.com/exceljs/exceljs/issues/1120">[BUG] Typescript error from getColumn.eachCell #1120</a>. Many thanks to <a href="https://github.com/nywleswoey">Selwyn Yeow</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1489">col-cache: optimize for performance #1489</a>. Many thanks to <a href="https://github.com/myfreeer">myfreeer</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1487">Add lastColumn property (fixes #1453) #1487</a>. This should fix <a href="https://github.com/exceljs/exceljs/issues/1453">property of worsheet.lastcolumn #1453</a>. Many thanks to <a href="https://github.com/FliegendeWurst">FliegendeWurst</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1495">Add a test for CSV writeFile encoding #1495</a>. This should close <a href="https://github.com/exceljs/exceljs/issues/1473">[BUG] Export CSV garbled characters #1473</a>. and <a href="https://github.com/exceljs/exceljs/issues/995">Can't get hebrew to display correctly in a generted CSV file #995</a>. Many thanks to <a href="https://github.com/ArtskydJ">Joseph Dykstra</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1496">Clarify <code>encoding</code> option is just for <code>.writeFile</code> #1496</a>. Many thanks to <a href="https://github.com/ArtskydJ">Joseph Dykstra</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1377">Merge cells after row insert #1377</a>. Many thanks to <a href="https://github.com/curtcommander">Curt Commander</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1484">Fix issue 1474 (to check invalid sheet name) #1484</a>. This should fix <a href="https://github.com/exceljs/exceljs/issues/1474">[BUG] Incorrectly handles '/', ':' characters in sheet name #1474</a>. Many thanks to <a href="https://github.com/skypesky">skypesky</a> for this contribution. </li> </ul></td> </tr> <tr> <td>4.2.1</td> <td><ul> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1550">Typing FillPattern fgColor should be optional #1550</a>. Many thanks to <a href="https://github.com/Andries-Smit">Andries Smit</a> for this contribution. </li> <li> Merged <a href="https://github.com/exceljs/exceljs/pull/1564">Fixed return type on getRows #1564</a>. Many thanks to <a href="https://github.com/pmcilwaine">Paul Mcilwaine</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/1606">Fix fullAddress row and col types #1606</a>. Many thanks to <a href="https://github.com/Akxe">Adam Eisenreich</a> for this contribution. </li> </ul></td> </tr> <tr> <td>4.3.0</td> <td><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></td> </tr> </tbody> </table> </div></article></div><div class="pv4"><h2 class="c7520c26">Readme</h2><h3 id="user-content-keywords" class="a0dff0b1 mt2 pt2 mb3 pb3 f4 fw6 b--black-10">Keywords</h3><ul class="list pl0"><li class="dib mr2"><a class="_75a5f581 f4 fw6 fl db pv1 ma1 black-70 link hover-black animate" href="/search?q=keywords:xlsx">xlsx</a></li><li class="dib mr2"><a class="_75a5f581 f4 fw6 fl db pv1 ma1 black-70 link hover-black animate" href="/search?q=keywords:json">json</a></li><li class="dib mr2"><a class="_75a5f581 f4 fw6 fl db pv1 ma1 black-70 link hover-black animate" href="/search?q=keywords:csv">csv</a></li><li class="dib mr2"><a class="_75a5f581 f4 fw6 fl db pv1 ma1 black-70 link hover-black animate" href="/search?q=keywords:excel">excel</a></li><li class="dib mr2"><a class="_75a5f581 f4 fw6 fl db pv1 ma1 black-70 link hover-black animate" href="/search?q=keywords:font">font</a></li><li class="dib mr2"><a class="_75a5f581 f4 fw6 fl db pv1 ma1 black-70 link hover-black animate" href="/search?q=keywords:border">border</a></li><li class="dib mr2"><a class="_75a5f581 f4 fw6 fl db pv1 ma1 black-70 link hover-black animate" href="/search?q=keywords:fill">fill</a></li><li class="dib mr2"><a class="_75a5f581 f4 fw6 fl db pv1 ma1 black-70 link hover-black animate" href="/search?q=keywords:number">number</a></li><li class="dib mr2"><a class="_75a5f581 f4 fw6 fl db pv1 ma1 black-70 link hover-black animate" href="/search?q=keywords:format">format</a></li><li class="dib mr2"><a class="_75a5f581 f4 fw6 fl db pv1 ma1 black-70 link hover-black animate" href="/search?q=keywords:number format">number format</a></li><li class="dib mr2"><a class="_75a5f581 f4 fw6 fl db pv1 ma1 black-70 link hover-black animate" href="/search?q=keywords:alignment">alignment</a></li><li class="dib mr2"><a class="_75a5f581 f4 fw6 fl db pv1 ma1 black-70 link hover-black animate" href="/search?q=keywords:office">office</a></li><li class="dib mr2"><a class="_75a5f581 f4 fw6 fl db pv1 ma1 black-70 link hover-black animate" href="/search?q=keywords:spreadsheet">spreadsheet</a></li><li class="dib mr2"><a class="_75a5f581 f4 fw6 fl db pv1 ma1 black-70 link hover-black animate" href="/search?q=keywords:workbook">workbook</a></li><li class="dib mr2"><a class="_75a5f581 f4 fw6 fl db pv1 ma1 black-70 link hover-black animate" href="/search?q=keywords:defined names">defined names</a></li><li class="dib mr2"><a class="_75a5f581 f4 fw6 fl db pv1 ma1 black-70 link hover-black animate" href="/search?q=keywords:data validations">data validations</a></li><li class="dib mr2"><a class="_75a5f581 f4 fw6 fl db pv1 ma1 black-70 link hover-black animate" href="/search?q=keywords:rich text">rich text</a></li><li class="dib mr2"><a class="_75a5f581 f4 fw6 fl db pv1 ma1 black-70 link hover-black animate" href="/search?q=keywords:in-cell format">in-cell format</a></li><li class="dib mr2"><a class="_75a5f581 f4 fw6 fl db pv1 ma1 black-70 link hover-black animate" href="/search?q=keywords:outlineLevel">outlineLevel</a></li><li class="dib mr2"><a class="_75a5f581 f4 fw6 fl db pv1 ma1 black-70 link hover-black animate" href="/search?q=keywords:views">views</a></li><li class="dib mr2"><a class="_75a5f581 f4 fw6 fl db pv1 ma1 black-70 link hover-black animate" href="/search?q=keywords:frozen">frozen</a></li><li class="dib mr2"><a class="_75a5f581 f4 fw6 fl db pv1 ma1 black-70 link hover-black animate" href="/search?q=keywords:split">split</a></li><li class="dib mr2"><a class="_75a5f581 f4 fw6 fl db pv1 ma1 black-70 link hover-black animate" href="/search?q=keywords:pageSetup">pageSetup</a></li></ul></div></section><section class="e22ba268 ph2 ph0-ns ml0-ns mr3-ns black-80" id="tabpanel-explore" aria-labelledby="package-tab-explore" role="tabpanel" data-attribute="hidden"></section><section class="e22ba268 ph2 ph0-ns ml0-ns mr3-ns black-80" id="tabpanel-admin" aria-labelledby="package-tab-admin" role="tabpanel" data-attribute="hidden"></section><section class="e22ba268 ph2 ph0-ns ml0-ns mr3-ns black-80" id="tabpanel-dependencies" aria-labelledby="package-tab-dependencies" role="tabpanel" data-attribute="hidden"></section><section class="e22ba268 ph2 ph0-ns ml0-ns mr3-ns black-80" id="tabpanel-dependents" aria-labelledby="package-tab-dependents" role="tabpanel" data-attribute="hidden"></section><div class="e22ba268 ph2 ph0-ns ml0-ns mr3-ns black-80" id="tabpanel-versions" aria-labelledby="package-tab-versions" role="tabpanel" data-attribute="hidden"></div></span><span aria-live="polite"></span></div><div class="fdbf4038 w-third-l mt3 w-100 ph3 ph4-m pv3 pv0-l"><h2 class="c7520c26">Package Sidebar</h2><h3 class="c84e15be f5 mt2 pt2 mb0">Install</h3><div class="d767adf4 lh-copy truncate ph0 mb3 black-80 b5be2af6 f6 flex flex-row"><svg viewBox="0 0 12.32 9.33" aria-hidden="true"><g><line class="st1" x1="7.6" y1="8.9" x2="7.6" y2="6.9"></line><rect width="1.9" height="1.9"></rect><rect x="1.9" y="1.9" width="1.9" height="1.9"></rect><rect x="3.7" y="3.7" width="1.9" height="1.9"></rect><rect x="1.9" y="5.6" width="1.9" height="1.9"></rect><rect y="7.5" width="1.9" height="1.9"></rect></g></svg><p class="flex-auto truncate db ma0"><code>npm i <!-- -->@wmakeev/exceljs</code><button class="fbd04dd1" type="button" aria-label="Copy install command line"><svg aria-hidden="true" focusable="false" data-prefix="far" data-icon="copy" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM266 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h74v224c0 26.51 21.49 48 48 48h96v42a6 6 0 0 1-6 6zm128-96H182a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h106v88c0 13.255 10.745 24 24 24h88v202a6 6 0 0 1-6 6zm6-256h-64V48h9.632c1.591 0 3.117.632 4.243 1.757l48.368 48.368a6 6 0 0 1 1.757 4.243V112z" fill="#808080"></path></svg></button></p></div><div class="_702d723c dib w-50 fl bb b--black-10 pr2 w-100"><h3 id="repository" class="c84e15be f5 mt2 pt2 mb0">Repository</h3><p class="_40aff104 fw6 mb3 mt2 truncate black-80 f5"><a aria-labelledby="repository repository-link" class="b2812e30 f2874b88 fw6 mb3 mt2 truncate black-80 f4 no-underline pr1" href="https://github.com/wmakeev/exceljs" target="_blank" rel="noopener noreferrer nofollow"><span class="_513426a8 dib v-mid"><svg width="16" height="16" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><title>Git</title><g fill="#0A0B09" fill-rule="nonzero"><path d="M15.6981994,7.28744895 L8.71251571,0.3018063 C8.3102891,-0.1006021 7.65784619,-0.1006021 7.25527133,0.3018063 L5.80464367,1.75263572 L7.64478689,3.59281398 C8.07243561,3.44828825 8.56276901,3.5452772 8.90352982,3.88604451 C9.24638012,4.22907547 9.34249661,4.72359725 9.19431703,5.15282127 L10.9679448,6.92630874 C11.3971607,6.77830046 11.8918472,6.8738964 12.2346975,7.21727561 C12.7135387,7.69595181 12.7135387,8.47203759 12.2346975,8.95106204 C11.755508,9.43026062 10.9796112,9.43026062 10.5002476,8.95106204 C10.140159,8.59061834 10.0510075,8.06127108 10.2336636,7.61759448 L8.57948492,5.9635584 L8.57948492,10.3160467 C8.69614805,10.3738569 8.80636859,10.4509954 8.90352982,10.5479843 C9.38237103,11.0268347 9.38237103,11.8027463 8.90352982,12.2822931 C8.42468862,12.7609693 7.64826937,12.7609693 7.16977641,12.2822931 C6.69093521,11.8027463 6.69093521,11.0268347 7.16977641,10.5479843 C7.28818078,10.4297518 7.42521643,10.3402504 7.57148065,10.2803505 L7.57148065,5.88746473 C7.42521643,5.82773904 7.28852903,5.73893407 7.16977641,5.62000506 C6.80707597,5.25747183 6.71983981,4.72499027 6.90597844,4.27957241 L5.09195384,2.465165 L0.301800552,7.25506126 C-0.100600184,7.65781791 -0.100600184,8.31027324 0.301800552,8.71268164 L7.28783254,15.6983243 C7.69005915,16.1005586 8.34232793,16.1005586 8.74507691,15.6983243 L15.6981994,8.74506934 C16.1006002,8.34266094 16.1006002,7.68968322 15.6981994,7.28744895" id="Path"></path></g></svg></span><span id="repository-link">github.com/wmakeev/exceljs</span></a></p></div><div class="_702d723c dib w-50 fl bb b--black-10 pr2 w-100"><h3 id="homePage" class="c84e15be f5 mt2 pt2 mb0">Homepage</h3><p class="_40aff104 fw6 mb3 mt2 truncate black-80 f5"><a aria-labelledby="homePage homePage-link" class="b2812e30 f2874b88 fw6 mb3 mt2 truncate black-80 f4 no-underline pr1" rel="noopener noreferrer nofollow" href="https://github.com/wmakeev/exceljs#readme"><svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="link" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z"></path></svg><span id="homePage-link">github.com/wmakeev/exceljs#readme</span></a></p></div><div><div class="_702d723c dib w-50 fl bb b--black-10 pr2 w-100" role="button" tabindex="0" aria-label="Showing weekly downloads"><h3 class="c84e15be f5 mt2 pt2 mb0 _5cfc0900"><svg viewBox="0 0 7.22 11.76" aria-hidden="true"><title>Downloads</title><g><polygon points="4.59 4.94 4.59 0 2.62 0 2.62 4.94 0 4.94 3.28 9.53 7.22 4.94 4.59 4.94" aria-label="Downloads icon"></polygon><rect x="0.11" y="10.76" width="7" height="1"></rect></g></svg>Weekly Downloads</h3><div class="_000ae427 flex flex-row-reverse items-end"><svg class="_418c4939 flex-none" width="200" height="40" stroke-width="3" stroke="#8956FF" fill="rgba(137, 86, 255, .2)" aria-hidden="true"></svg><p class="_9ba9a726 f4 tl flex-auto fw6 black-80 ma0 pr2 pb1">14</p></div></div></div><div class="_702d723c dib w-50 fl bb b--black-10 pr2"><h3 class="c84e15be f5 mt2 pt2 mb0">Version</h3><div class="abe380b3 flex flex-row items-center"><p class="f2874b88 fw6 mb3 mt2 truncate black-80 f4">4.4.5</p></div></div><div class="_702d723c dib w-50 fl bb b--black-10 pr2"><h3 class="c84e15be f5 mt2 pt2 mb0">License</h3><p class="f2874b88 fw6 mb3 mt2 truncate black-80 f4">MIT</p></div><div class="_702d723c dib w-50 fl bb b--black-10 pr2"><h3 class="c84e15be f5 mt2 pt2 mb0">Unpacked Size</h3><p class="f2874b88 fw6 mb3 mt2 truncate black-80 f4">22.7 MB</p></div><div class="_702d723c dib w-50 fl bb b--black-10 pr2"><h3 class="c84e15be f5 mt2 pt2 mb0">Total Files</h3><p class="f2874b88 fw6 mb3 mt2 truncate black-80 f4">537</p></div><div class="_702d723c dib w-50 fl bb b--black-10 pr2 w-100"><h3 class="c84e15be f5 mt2 pt2 mb0">Last publish</h3><p class="f2874b88 fw6 mb3 mt2 truncate black-80 f4"><time dateTime="2024-07-15T07:27:12.054Z" title="7/15/2024, 7:27:12 AM">4 months ago</time></p></div><div class="_702d723c dib w-50 fl bb b--black-10 pr2 bb-0 w-100"><h3 id="collaborators" class="c84e15be f5 mt2 pt2 mb0">Collaborators</h3><ul aria-labelledby="collaborators" class="list pl0 cf"><li class="_426b8533 fl dib mr2 mb2"><div><a href="/~wmakeev"><img src="/npm-avatar/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdmF0YXJVUkwiOiJodHRwczovL3MuZ3JhdmF0YXIuY29tL2F2YXRhci9iNWFmODdiMjNmN2VmMDQyNjdkOTgyMDYwYzVlN2IzZD9zaXplPTEwMCZkZWZhdWx0PXJldHJvIn0.R-kZ1u5wzUMmU7E8WZMs3mCP5erf_mjeWldVuItZWWo" style="width:42px;height:42px;min-width:42px;border-radius:4%" alt="wmakeev" title="wmakeev"/></a></div></li></ul></div><div class="w-100"><a class="c37751f6 _24a1e9c7 dab9924c br2 pv2 ph3 fw5 f5 tc button button-reset pointer ma2 truncate ml0 no-underline mt2 dib w-100" rel="noopener noreferrer nofollow" href="https://runkit.com/npm/%40wmakeev%2Fexceljs"><svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="terminal" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path fill="currentColor" d="M257.981 272.971L63.638 467.314c-9.373 9.373-24.569 9.373-33.941 0L7.029 444.647c-9.357-9.357-9.375-24.522-.04-33.901L161.011 256 6.99 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L257.981 239.03c9.373 9.372 9.373 24.568 0 33.941zM640 456v-32c0-13.255-10.745-24-24-24H312c-13.255 0-24 10.745-24 24v32c0 13.255 10.745 24 24 24h304c13.255 0 24-10.745 24-24z"></path></svg><strong>Try</strong> on RunKit</a></div><div class="_33c89934 w-100"><a class="_4a3f8f21 _24a1e9c7 dab9924c br2 pv2 ph3 fw5 f5 tc button button-reset pointer ma2 truncate ml0 no-underline mt2 dib w-100" href="/support?inquire=security&security-inquire=malware&package=%40wmakeev%2Fexceljs&version=4.4.5"><svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="flag" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M349.565 98.783C295.978 98.783 251.721 64 184.348 64c-24.955 0-47.309 4.384-68.045 12.013a55.947 55.947 0 0 0 3.586-23.562C118.117 24.015 94.806 1.206 66.338.048 34.345-1.254 8 24.296 8 56c0 19.026 9.497 35.825 24 45.945V488c0 13.255 10.745 24 24 24h16c13.255 0 24-10.745 24-24v-94.4c28.311-12.064 63.582-22.122 114.435-22.122 53.588 0 97.844 34.783 165.217 34.783 48.169 0 86.667-16.294 122.505-40.858C506.84 359.452 512 349.571 512 339.045v-243.1c0-23.393-24.269-38.87-45.485-29.016-34.338 15.948-76.454 31.854-116.95 31.854z"></path></svg><strong>Report</strong> malware</a></div></div></div> </main><footer class="cd2827bb bt b--black-10 mt4"><h2 class="e13b5dae">Footer</h2><div id="footer" class="center mw9 pa3 flex flex-column flex-wrap-m flex-row-ns"><div class="flex-auto pa4-ns pa3 w-100 w-10-l"><div class="_802b5507 pt3"><a target="_blank" rel="noopener noreferrer nofollow" href="https://github.com/npm" aria-label="Visit npm GitHub page"><svg viewBox="0 0 27.23 27.23" aria-hidden="true"><rect fill="#333333" width="27.23" height="27.23" rx="2"></rect><polygon fill="#fff" points="5.8 21.75 13.66 21.75 13.67 9.98 17.59 9.98 17.58 21.76 21.51 21.76 21.52 6.06 5.82 6.04 5.8 21.75"></polygon></svg></a></div><div class="_802b5507 pt3"><a target="_blank" rel="noopener noreferrer nofollow" href="https://github.com" aria-label="GitHub"><svg aria-hidden="true" focusable="false" class="" viewBox="0 0 24 24" width="50" height="50" fill="black" style="display:inline-block;user-select:none;vertical-align:top;overflow:visible"><path d="M12.5.75C6.146.75 1 5.896 1 12.25c0 5.089 3.292 9.387 7.863 10.91.575.101.79-.244.79-.546 0-.273-.014-1.178-.014-2.142-2.889.532-3.636-.704-3.866-1.35-.13-.331-.69-1.352-1.18-1.625-.402-.216-.977-.748-.014-.762.906-.014 1.553.834 1.769 1.179 1.035 1.74 2.688 1.25 3.349.948.1-.747.402-1.25.733-1.538-2.559-.287-5.232-1.279-5.232-5.678 0-1.25.445-2.285 1.178-3.09-.115-.288-.517-1.467.115-3.048 0 0 .963-.302 3.163 1.179.92-.259 1.897-.388 2.875-.388.977 0 1.955.13 2.875.388 2.2-1.495 3.162-1.179 3.162-1.179.633 1.581.23 2.76.115 3.048.733.805 1.179 1.825 1.179 3.09 0 4.413-2.688 5.39-5.247 5.678.417.36.776 1.05.776 2.128 0 1.538-.014 2.774-.014 3.162 0 .302.216.662.79.547C20.709 21.637 24 17.324 24 12.25 24 5.896 18.854.75 12.5.75Z"></path></svg></a></div></div><div class="flex-auto pa4-ns pa3 w-30-ns w-50-m"><h3 id="support" class="_1b8c0a9f">Support</h3><ul class="list pl0" aria-labelledby="support"><li class="pv1"><a class="df995acb no-underline pr1" href="https://docs.npmjs.com">Help</a></li><li class="pv1"><a class="df995acb no-underline pr1" href="https://github.com/advisories">Advisories</a></li><li class="pv1"><a class="df995acb no-underline pr1" href="http://status.npmjs.org/">Status</a></li><li class="pv1"><a class="df995acb no-underline pr1" href="/support">Contact npm</a></li></ul></div><div class="flex-auto pa4-ns pa3 w-30-ns w-50-m"><h3 id="company" class="_1b8c0a9f">Company</h3><ul class="list pl0" aria-labelledby="company"><li class="pv1"><a class="df995acb no-underline pr1" href="/about">About</a></li><li class="pv1"><a class="df995acb no-underline pr1" href="https://github.blog/tag/npm/">Blog</a></li><li class="pv1"><a class="df995acb no-underline pr1" href="/press">Press</a></li></ul></div><div class="flex-auto pa4-ns pa3 w-30-ns w-50-m"><h3 id="terms" class="_1b8c0a9f">Terms & Policies</h3><ul class="list pl0" aria-labelledby="terms"><li class="pv1"><a class="df995acb no-underline pr1" href="/policies/">Policies</a></li><li class="pv1"><a class="df995acb no-underline pr1" href="/policies/terms">Terms of Use</a></li><li class="pv1"><a class="df995acb no-underline pr1" href="/policies/conduct">Code of Conduct</a></li><li class="pv1"><a class="df995acb no-underline pr1" href="/policies/privacy">Privacy</a></li></ul></div></div></footer></div><div class="_8a62ca63 fixed top-0 left-0 z-999" style="opacity:0;transform:scaleX(1);-webkit-transform:scaleX(1);-moz-transform:scaleX(1)"></div></div></div><script integrity="sha512-Z2B+NY8KuJqeNI/cv5JG2DHFxg97LCOfl18/zQt5wScIwQVDRtZUQogd2VHFYwNnoEHG8psDRtldDbjN0/TUYA==">window.__context__ = {"context":{"notifications":[],"csrftoken":"gMluPm4gTkuqL9xN7pegvrtvclOQy5UYDwjSvtv7fl0","userEmailVerified":null,"isV3SearchEnabled":false,"auditLogEnabled":false,"user":null,"documentContext":{"readme.data":"readme"},"undefined":true,"readme":{"ref":"readme","data":null},"versionsDownloads":{"4.4.5":12,"4.4.1":1,"4.4.4":1},"starAction":"/package/%40wmakeev%2Fexceljs/star","scope":"wmakeev","provenance":{"enabled":false,"feedbackUrl":" https://github.com/npm/feedback"},"isSecurityPlaceholder":false,"private":false,"packument":{"author":{"name":"Guyon Roche","avatars":{"small":"/npm-avatar/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdmF0YXJVUkwiOiJodHRwczovL3MuZ3JhdmF0YXIuY29tL2F2YXRhci9jYTA1YTljMzQxYzkxMWE1ZjUxZWIyODNmYjU2Y2E4Yz9zaXplPTUwJmRlZmF1bHQ9cmV0cm8ifQ.BbP118h6_HW3ZOGd_k6pB_OWXYIqZLrDStseBNH6dMM","medium":"/npm-avatar/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdmF0YXJVUkwiOiJodHRwczovL3MuZ3JhdmF0YXIuY29tL2F2YXRhci9jYTA1YTljMzQxYzkxMWE1ZjUxZWIyODNmYjU2Y2E4Yz9zaXplPTEwMCZkZWZhdWx0PXJldHJvIn0.DnPrkzIjXhyEwAwBONhqKpDdQRQNAi_JpYUGP0v6EO8","large":"/npm-avatar/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdmF0YXJVUkwiOiJodHRwczovL3MuZ3JhdmF0YXIuY29tL2F2YXRhci9jYTA1YTljMzQxYzkxMWE1ZjUxZWIyODNmYjU2Y2E4Yz9zaXplPTQ5NiZkZWZhdWx0PXJldHJvIn0.0D3RAgw7ZCpYY-kPJFTJU4Ruol5G40JP05tzFs05ShU"}},"description":"Excel Workbook Manager - Read and Write xlsx and csv Files.","homepage":"https://github.com/wmakeev/exceljs#readme","repository":"https://github.com/wmakeev/exceljs","distTags":{"latest":"4.4.5"},"keywords":["xlsx","json","csv","excel","font","border","fill","number","format","number format","alignment","office","spreadsheet","workbook","defined names","data validations","rich text","in-cell format","outlineLevel","views","frozen","split","pageSetup"],"maintainers":[{"name":"wmakeev","avatars":{"small":"/npm-avatar/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdmF0YXJVUkwiOiJodHRwczovL3MuZ3JhdmF0YXIuY29tL2F2YXRhci9iNWFmODdiMjNmN2VmMDQyNjdkOTgyMDYwYzVlN2IzZD9zaXplPTUwJmRlZmF1bHQ9cmV0cm8ifQ.LMW14Lo7vpJFYN9IiSvBQIu7A9V0DD6XAgspUcSWmtk","medium":"/npm-avatar/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdmF0YXJVUkwiOiJodHRwczovL3MuZ3JhdmF0YXIuY29tL2F2YXRhci9iNWFmODdiMjNmN2VmMDQyNjdkOTgyMDYwYzVlN2IzZD9zaXplPTEwMCZkZWZhdWx0PXJldHJvIn0.R-kZ1u5wzUMmU7E8WZMs3mCP5erf_mjeWldVuItZWWo","large":"/npm-avatar/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdmF0YXJVUkwiOiJodHRwczovL3MuZ3JhdmF0YXIuY29tL2F2YXRhci9iNWFmODdiMjNmN2VmMDQyNjdkOTgyMDYwYzVlN2IzZD9zaXplPTQ5NiZkZWZhdWx0PXJldHJvIn0.uT2K8SQoqBOpYKkMy4GQJw8Y8i_nDrJ8nFit5mrAghA"}}],"name":"@wmakeev/exceljs","license":"MIT","version":"4.4.5","versions":[{"version":"4.4.5","date":{"ts":1721028432054,"rel":"4 months ago"},"dist":{"integrity":"sha512-tIH0p6CQEzBkzfkg0JjdXtDCgq3m2hfD5TUEFFSv/Nu9i12LuhsGuW4TvZ34TyJ2ay1xavnK2wJES0tsa/7ReA==","shasum":"53c2ff507fe1093049d61634c941439382667eb4","tarball":"https://registry.npmjs.org/@wmakeev/exceljs/-/exceljs-4.4.5.tgz","fileCount":537,"unpackedSize":22657295,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCw4jE4hOsMrZmv14YAtrHHGFiHxa8IDP5E0GX5AN3aHwIgNXTxnSbYEOHe+bpjzbUIJGi6mOMfRa9wt7FTfPM1aic="}]}},{"version":"4.4.4","date":{"ts":1715711933122,"rel":"6 months ago"},"dist":{"shasum":"2123946a707e055c81e2828b82e94d6e798aba6d","tarball":"https://registry.npmjs.org/@wmakeev/exceljs/-/exceljs-4.4.4.tgz","fileCount":537,"integrity":"sha512-YGGIDT8j+siFcDAWZHu2oxZZylHzAI1R2uL8Db7fAFn8iUooGWSTTCHYYMLojMLCZAeFTdsyOYuDpKSTgAk+ug==","signatures":[{"sig":"MEUCIGa4T7C/DSh/uvo2fwHKJMPC3EsyJqZeGjAbnwTilvkoAiEA+ymaZh2JgtRgXZHtHla1lkah8rJGw1pj7S7vjfCqIeQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22657232}},{"version":"4.4.3","date":{"ts":1714971012463,"rel":"7 months ago"},"dist":{"shasum":"55fc2ec750e617f4dc4ffac9d7acf40ff0224cff","tarball":"https://registry.npmjs.org/@wmakeev/exceljs/-/exceljs-4.4.3.tgz","fileCount":537,"integrity":"sha512-+bjnYPvtSAhCCSrU3W7pOW25BHXMEaXW1O92K5VFD+chdvcmGLJw5Rcni36DLbsLJFAnQfWXfX4lu73wIgzbjw==","signatures":[{"sig":"MEUCIQDzQtXGvnJ5J1kemeAVNWaET6jUglCJGGCQyBC0SqkTlwIgWLWOlvC4J+IT6kfZQUGj8wvemnp2tW3TOJOvgboP+DI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22656966}},{"version":"4.4.2","date":{"ts":1712930610226,"rel":"7 months ago"},"dist":{"shasum":"570e5eb91f3abb2049b9b5641eb6963d814a4bea","tarball":"https://registry.npmjs.org/@wmakeev/exceljs/-/exceljs-4.4.2.tgz","fileCount":537,"integrity":"sha512-GsTBW/snJVD6rmySVBZ7+YVHucW0YQSJ0b8Gg+LVf2q6Nt6RdeiCxom/wCCQUC+b7a3O4kJ3+60K6w2RiVvrzQ==","signatures":[{"sig":"MEMCIC8YHkXES98Lr2fGro8AP4UODc6ax2Vjvet3RdgMXpsZAh9FfzsuvgPGK0NdvXgdDRSeWoIYLWUwdNuHcS9CiQIJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22656516}},{"version":"4.4.1","date":{"ts":1712930360816,"rel":"7 months ago"},"dist":{"shasum":"4026e3f72960832d033aee15a88c5b5a3bd4354a","tarball":"https://registry.npmjs.org/@wmakeev/exceljs/-/exceljs-4.4.1.tgz","fileCount":537,"integrity":"sha512-4QRj9CTJiTnZnXNKalp4d6o+ZvYoJX5juVVM5aYXK0z2RwhJaeICCFu4lolKw6CtcBmcZgSGX0lhMX4AJDrk2A==","signatures":[{"sig":"MEUCIQD3/yiar6ydgRYzhnC1b0ZZsHKEeaxkigAhaYIaYqzZ7QIgAsS13sL63/n6YP9oS4maQpjOQYdqwJGLCzGWQGD17NY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":22655418}}],"deprecations":[]},"packageVersion":{"author":{"name":"Guyon Roche","avatars":{"small":"/npm-avatar/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdmF0YXJVUkwiOiJodHRwczovL3MuZ3JhdmF0YXIuY29tL2F2YXRhci9jYTA1YTljMzQxYzkxMWE1ZjUxZWIyODNmYjU2Y2E4Yz9zaXplPTUwJmRlZmF1bHQ9cmV0cm8ifQ.BbP118h6_HW3ZOGd_k6pB_OWXYIqZLrDStseBNH6dMM","medium":"/npm-avatar/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdmF0YXJVUkwiOiJodHRwczovL3MuZ3JhdmF0YXIuY29tL2F2YXRhci9jYTA1YTljMzQxYzkxMWE1ZjUxZWIyODNmYjU2Y2E4Yz9zaXplPTEwMCZkZWZhdWx0PXJldHJvIn0.DnPrkzIjXhyEwAwBONhqKpDdQRQNAi_JpYUGP0v6EO8","large":"/npm-avatar/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdmF0YXJVUkwiOiJodHRwczovL3MuZ3JhdmF0YXIuY29tL2F2YXRhci9jYTA1YTljMzQxYzkxMWE1ZjUxZWIyODNmYjU2Y2E4Yz9zaXplPTQ5NiZkZWZhdWx0PXJldHJvIn0.0D3RAgw7ZCpYY-kPJFTJU4Ruol5G40JP05tzFs05ShU"}},"description":"Excel Workbook Manager - Read and Write xlsx and csv Files.","homepage":"https://github.com/wmakeev/exceljs#readme","repository":"https://github.com/wmakeev/exceljs","keywords":["xlsx","json","csv","excel","font","border","fill","number","format","number format","alignment","office","spreadsheet","workbook","defined names","data validations","rich text","in-cell format","outlineLevel","views","frozen","split","pageSetup"],"dependencies":{"archiver":"^5.0.0","dayjs":"^1.8.34","fast-csv":"^4.3.1","jszip":"^3.10.1","readable-stream":"^3.6.0","saxes":"^5.0.1","tmp":"^0.2.0","unzipper":"^0.10.11","uuid":"^8.3.0"},"devDependencies":{"@babel/cli":"^7.10.5","@babel/core":"^7.11.4","@babel/preset-env":"^7.11.0","@types/chai":"^4.2.12","@types/mocha":"^8.0.3","@types/node":"^14.11.2","babelify":"^10.0.0","browserify":"^16.5.2","chai":"^4.2.0","chai-datetime":"^1.7.0","chai-xml":"^0.3.2","core-js":"^3.6.5","dirty-chai":"^2.0.1","eslint":"^6.5.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.12.0","eslint-friendly-formatter":"^4.0.1","eslint-plugin-import":"^2.22.0","eslint-plugin-node":"^11.1.0","express":"^4.16.4","got":"^9.0.0","grunt":"^1.3.0","grunt-babel":"^8.0.0","grunt-browserify":"^5.3.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-jasmine":"^2.2.0","grunt-contrib-watch":"^1.1.0","grunt-exorcise":"^2.1.1","grunt-terser":"^1.0.0","husky":"^4.3.0","lint-staged":"^10.2.13","mocha":"^7.2.0","prettier-eslint":"^11.0.0","prettier-eslint-cli":"^5.0.0","regenerator-runtime":"^0.13.7","sax":"^1.2.4","ts-node":"^8.10.2","typescript":"^3.9.7"},"maintainers":[{"name":"wmakeev","avatars":{"small":"/npm-avatar/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdmF0YXJVUkwiOiJodHRwczovL3MuZ3JhdmF0YXIuY29tL2F2YXRhci9iNWFmODdiMjNmN2VmMDQyNjdkOTgyMDYwYzVlN2IzZD9zaXplPTUwJmRlZmF1bHQ9cmV0cm8ifQ.LMW14Lo7vpJFYN9IiSvBQIu7A9V0DD6XAgspUcSWmtk","medium":"/npm-avatar/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdmF0YXJVUkwiOiJodHRwczovL3MuZ3JhdmF0YXIuY29tL2F2YXRhci9iNWFmODdiMjNmN2VmMDQyNjdkOTgyMDYwYzVlN2IzZD9zaXplPTEwMCZkZWZhdWx0PXJldHJvIn0.R-kZ1u5wzUMmU7E8WZMs3mCP5erf_mjeWldVuItZWWo","large":"/npm-avatar/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdmF0YXJVUkwiOiJodHRwczovL3MuZ3JhdmF0YXIuY29tL2F2YXRhci9iNWFmODdiMjNmN2VmMDQyNjdkOTgyMDYwYzVlN2IzZD9zaXplPTQ5NiZkZWZhdWx0PXJldHJvIn0.uT2K8SQoqBOpYKkMy4GQJw8Y8i_nDrJ8nFit5mrAghA"}}],"name":"@wmakeev/exceljs","license":"MIT","version":"4.4.5","versions":[],"deprecations":[],"types":"./index.d.ts"},"packageUrl":"/package/@wmakeev/exceljs","packageLinkingCallToActionHref":null,"package":"@wmakeev/exceljs","linkingAllowedForPackage":false,"isStarred":false,"ghapi":"https://api.github.com/repos/wmakeev/exceljs","downloads":[{"downloads":0,"label":"2023-11-26 to 2023-12-02"},{"downloads":0,"label":"2023-12-03 to 2023-12-09"},{"downloads":0,"label":"2023-12-10 to 2023-12-16"},{"downloads":0,"label":"2023-12-17 to 2023-12-23"},{"downloads":0,"label":"2023-12-24 to 2023-12-30"},{"downloads":0,"label":"2023-12-31 to 2024-01-06"},{"downloads":0,"label":"2024-01-07 to 2024-01-13"},{"downloads":0,"label":"2024-01-14 to 2024-01-20"},{"downloads":0,"label":"2024-01-21 to 2024-01-27"},{"downloads":0,"label":"2024-01-28 to 2024-02-03"},{"downloads":0,"label":"2024-02-04 to 2024-02-10"},{"downloads":0,"label":"2024-02-11 to 2024-02-17"},{"downloads":0,"label":"2024-02-18 to 2024-02-24"},{"downloads":0,"label":"2024-02-25 to 2024-03-02"},{"downloads":0,"label":"2024-03-03 to 2024-03-09"},{"downloads":0,"label":"2024-03-10 to 2024-03-16"},{"downloads":0,"label":"2024-03-17 to 2024-03-23"},{"downloads":0,"label":"2024-03-24 to 2024-03-30"},{"downloads":0,"label":"2024-03-31 to 2024-04-06"},{"downloads":64,"label":"2024-04-07 to 2024-04-13"},{"downloads":31,"label":"2024-04-14 to 2024-04-20"},{"downloads":6,"label":"2024-04-21 to 2024-04-27"},{"downloads":5,"label":"2024-04-28 to 2024-05-04"},{"downloads":62,"label":"2024-05-05 to 2024-05-11"},{"downloads":52,"label":"2024-05-12 to 2024-05-18"},{"downloads":10,"label":"2024-05-19 to 2024-05-25"},{"downloads":3,"label":"2024-05-26 to 2024-06-01"},{"downloads":6,"label":"2024-06-02 to 2024-06-08"},{"downloads":1,"label":"2024-06-09 to 2024-06-15"},{"downloads":3,"label":"2024-06-16 to 2024-06-22"},{"downloads":4,"label":"2024-06-23 to 2024-06-29"},{"downloads":25,"label":"2024-06-30 to 2024-07-06"},{"downloads":4,"label":"2024-07-07 to 2024-07-13"},{"downloads":80,"label":"2024-07-14 to 2024-07-20"},{"downloads":10,"label":"2024-07-21 to 2024-07-27"},{"downloads":20,"label":"2024-07-28 to 2024-08-03"},{"downloads":21,"label":"2024-08-04 to 2024-08-10"},{"downloads":5,"label":"2024-08-11 to 2024-08-17"},{"downloads":23,"label":"2024-08-18 to 2024-08-24"},{"downloads":11,"label":"2024-08-25 to 2024-08-31"},{"downloads":10,"label":"2024-09-01 to 2024-09-07"},{"downloads":4,"label":"2024-09-08 to 2024-09-14"},{"downloads":5,"label":"2024-09-15 to 2024-09-21"},{"downloads":16,"label":"2024-09-22 to 2024-09-28"},{"downloads":11,"label":"2024-09-29 to 2024-10-05"},{"downloads":16,"label":"2024-10-06 to 2024-10-12"},{"downloads":33,"label":"2024-10-13 to 2024-10-19"},{"downloads":27,"label":"2024-10-20 to 2024-10-26"},{"downloads":37,"label":"2024-10-27 to 2024-11-02"},{"downloads":41,"label":"2024-11-03 to 2024-11-09"},{"downloads":14,"label":"2024-11-10 to 2024-11-16"},{"downloads":14,"label":"2024-11-17 to 2024-11-23"}],"dependents":{"dependentsCount":1,"dependentsTruncated":["@wmakeev/xlsx-to-csv"]},"capsule":{"name":"@wmakeev/exceljs","description":"Excel Workbook Manager - Read and Write xlsx and csv Files.","maintainers":["wmakeev"],"dist-tags":{"latest":"4.4.5"},"lastPublish":{"maintainer":"wmakeev","time":"2024-07-15T07:27:12.054Z"},"types":{"typescript":{"bundled":"./index.d.ts"}}},"canEditPackage":false},"chunks":{"commons":["commons.b79be12adf7a5316de1e.js","commons.b79be12adf7a5316de1e.js.map"],"styles":["styles.c617df3efc3b584cc1d7.css","minicssextractbug.d20b6beec9f84f3c51f4.js","styles.c617df3efc3b584cc1d7.css.map","minicssextractbug.d20b6beec9f84f3c51f4.js.map"],"acceptance/acceptance":["acceptance/acceptance.8f158bb6f917058edc15.js","acceptance/acceptance.8f158bb6f917058edc15.js.map"],"audit-logs/actions/common/auditLogContainer":["audit-logs/actions/common/auditLogContainer.b53482e6e8d59f143dd9.js","audit-logs/actions/common/auditLogContainer.b53482e6e8d59f143dd9.js.map"],"audit-logs/actions/common/dot":["audit-logs/actions/common/dot.c9c77b74c1f2a46df71a.js","audit-logs/actions/common/dot.c9c77b74c1f2a46df71a.js.map"],"audit-logs/actions/common/filterActions":["audit-logs/actions/common/filterActions.1c4e17f8eee2580fb525.js","audit-logs/actions/common/filterActions.1c4e17f8eee2580fb525.js.map"],"audit-logs/actions/common/spaceGap":["audit-logs/actions/common/spaceGap.492b805c8fd7f0477e90.js","audit-logs/actions/common/spaceGap.492b805c8fd7f0477e90.js.map"],"audit-logs/actions/orgAddUser":["audit-logs/actions/orgAddUser.0f31c5ea1667ae4f4352.js","audit-logs/actions/orgAddUser.0f31c5ea1667ae4f4352.js.map"],"audit-logs/actions/orgCreateTeam":["audit-logs/actions/orgCreateTeam.6b14599a54a04e6d1051.js","audit-logs/actions/orgCreateTeam.6b14599a54a04e6d1051.js.map"],"audit-logs/actions/orgDeleteTeam":["audit-logs/actions/orgDeleteTeam.aae4b5efa098d755e655.js","audit-logs/actions/orgDeleteTeam.aae4b5efa098d755e655.js.map"],"audit-logs/actions/orgRemoveUser":["audit-logs/actions/orgRemoveUser.e08363d532659cd80b38.js","audit-logs/actions/orgRemoveUser.e08363d532659cd80b38.js.map"],"audit-logs/actions/packageAddDistTag":["audit-logs/actions/packageAddDistTag.04901ad0124d77154cce.js","audit-logs/actions/packageAddDistTag.04901ad0124d77154cce.js.map"],"audit-logs/actions/packageDeprecate":["audit-logs/actions/packageDeprecate.35c6da318f905a6bf1f6.js","audit-logs/actions/packageDeprecate.35c6da318f905a6bf1f6.js.map"],"audit-logs/actions/packagePublish":["audit-logs/actions/packagePublish.729831beb78e6d96f9f2.js","audit-logs/actions/packagePublish.729831beb78e6d96f9f2.js.map"],"audit-logs/actions/packageRemoveDistTag":["audit-logs/actions/packageRemoveDistTag.22e2962ec6870a30e58e.js","audit-logs/actions/packageRemoveDistTag.22e2962ec6870a30e58e.js.map"],"audit-logs/actions/packageUnpublish":["audit-logs/actions/packageUnpublish.b324240e345d5642454d.js","audit-logs/actions/packageUnpublish.b324240e345d5642454d.js.map"],"audit-logs/actions/packageUpdateAccess":["audit-logs/actions/packageUpdateAccess.36b80a359bfca15db60c.js","audit-logs/actions/packageUpdateAccess.36b80a359bfca15db60c.js.map"],"audit-logs/actions/teamAddPackage":["audit-logs/actions/teamAddPackage.ea101b31350f95441e06.js","audit-logs/actions/teamAddPackage.ea101b31350f95441e06.js.map"],"audit-logs/actions/teamAddUser":["audit-logs/actions/teamAddUser.c0e25078bded50e7bb86.js","audit-logs/actions/teamAddUser.c0e25078bded50e7bb86.js.map"],"audit-logs/actions/teamRemovePackage":["audit-logs/actions/teamRemovePackage.eda9b927db6081e54b14.js","audit-logs/actions/teamRemovePackage.eda9b927db6081e54b14.js.map"],"audit-logs/actions/teamRemoveUser":["audit-logs/actions/teamRemoveUser.9d04376f4805de3e9ed9.js","audit-logs/actions/teamRemoveUser.9d04376f4805de3e9ed9.js.map"],"audit-logs/actions/teamUpdatePackageAccess":["audit-logs/actions/teamUpdatePackageAccess.1c12462cbf2723411be2.js","audit-logs/actions/teamUpdatePackageAccess.1c12462cbf2723411be2.js.map"],"audit-logs/audit-logs":["audit-logs/audit-logs.84bf18eb71c53a904abd.js","audit-logs/audit-logs.84bf18eb71c53a904abd.js.map"],"audit-logs/audit-search-input":["audit-logs/audit-search-input.523cd907c3783e6df929.js","audit-logs/audit-search-input.523cd907c3783e6df929.js.map"],"audit-logs/list":["audit-logs/list.f1352bddddbcaafec2c8.js","audit-logs/list.f1352bddddbcaafec2c8.js.map"],"audit-logs/no-logs":["audit-logs/no-logs.981070ccacb6bef1146a.js","audit-logs/no-logs.981070ccacb6bef1146a.js.map"],"audit-logs/no-logs-with-query":["audit-logs/no-logs-with-query.3c718bcab9eb6a9aac8c.js","audit-logs/no-logs-with-query.3c718bcab9eb6a9aac8c.js.map"],"auth/account-recovery-message":["auth/account-recovery-message.d3d0a9c5aab77c31bf16.js","auth/account-recovery-message.d3d0a9c5aab77c31bf16.js.map"],"auth/authentication-successful":["auth/authentication-successful.89e95385555c15026571.js","auth/authentication-successful.89e95385555c15026571.js.map"],"auth/email-otp":["auth/email-otp.3279bf105e863189d4a7.js","auth/email-otp.3279bf105e863189d4a7.js.map"],"auth/escalate":["auth/escalate.b5713ed563299a8ab350.js","auth/escalate.b5713ed563299a8ab350.js.map"],"auth/forgot":["auth/forgot.287baf56741695c53d34.js","auth/forgot.287baf56741695c53d34.js.map"],"auth/forgot-sent":["auth/forgot-sent.ffadf9676fa54b2e82f0.js","auth/forgot-sent.ffadf9676fa54b2e82f0.js.map"],"auth/forgot-sent-anonymized":["auth/forgot-sent-anonymized.2f4c7b204e053346dbb7.js","auth/forgot-sent-anonymized.2f4c7b204e053346dbb7.js.map"],"auth/invite-signup":["auth/invite-signup.6b3ca39c21161aa7aa4b.js","auth/invite-signup.6b3ca39c21161aa7aa4b.js.map"],"auth/liminal-login-footer":["auth/liminal-login-footer.b0a6c721462424c315b6.js","auth/liminal-login-footer.b0a6c721462424c315b6.js.map"],"auth/login":["auth/login.d73d8ab4023a4fae00f2.js","auth/login.d73d8ab4023a4fae00f2.js.map"],"auth/otp":["auth/otp.d66d1f2c3e7ac740a735.js","auth/otp.d66d1f2c3e7ac740a735.js.map"],"auth/password":["auth/password.bd7abeefd167e1477640.js","auth/password.bd7abeefd167e1477640.js.map"],"auth/recovery-code":["auth/recovery-code.56ab0d8fec282e5241ef.js","auth/recovery-code.56ab0d8fec282e5241ef.js.map"],"auth/recovery-email-otp":["auth/recovery-email-otp.c39a61feadf4cfe92c69.js","auth/recovery-email-otp.c39a61feadf4cfe92c69.js.map"],"auth/reset-password":["auth/reset-password.4d9f8a6fe7a7f23eb7e8.js","auth/reset-password.4d9f8a6fe7a7f23eb7e8.js.map"],"auth/signup":["auth/signup.d816b922686bddff6edb.js","auth/signup.d816b922686bddff6edb.js.map"],"auth/test/email-otp-test":["auth/test/email-otp-test.a6d6867594488d8f2281.js","auth/test/email-otp-test.a6d6867594488d8f2281.js.map"],"auth/test/escalate-test":["auth/test/escalate-test.9fd56559c2d09eea5c10.js","auth/test/escalate-test.9fd56559c2d09eea5c10.js.map"],"auth/test/otp-test":["auth/test/otp-test.d1c4bddaa5a5d30df9db.js","auth/test/otp-test.d1c4bddaa5a5d30df9db.js.map"],"auth/test/webauthn-login-test":["auth/test/webauthn-login-test.ffe93475a9861015a293.js","auth/test/webauthn-login-test.ffe93475a9861015a293.js.map"],"auth/webauthn-cli-login":["auth/webauthn-cli-login.0b3ee2f30201bfa8a451.js","auth/webauthn-cli-login.0b3ee2f30201bfa8a451.js.map"],"auth/webauthn-login":["auth/webauthn-login.2dc9191ceaad30640841.js","auth/webauthn-login.2dc9191ceaad30640841.js.map"],"billing/delete-org":["billing/delete-org.d20bd0f1aaacb8fc90d7.js","billing/delete-org.d20bd0f1aaacb8fc90d7.js.map"],"billing/detail":["billing/detail.f9a60c5242880e6d43f5.js","billing/detail.f9a60c5242880e6d43f5.js.map"],"billing/downgrade":["billing/downgrade.92d9ff7d4bff0441004b.js","billing/downgrade.92d9ff7d4bff0441004b.js.map"],"billing/upgrade":["billing/upgrade.173ac6b34ec110b0769f.js","billing/upgrade.173ac6b34ec110b0769f.js.map"],"contact/contact":["contact/contact.430ee63adf050e9ba912.js","contact/contact.430ee63adf050e9ba912.js.map"],"contact/recovery-support-v1":["contact/recovery-support-v1.3b9658cf19820ba5b196.js","contact/recovery-support-v1.3b9658cf19820ba5b196.js.map"],"contact/recovery-support-v2":["contact/recovery-support-v2.6b076d1b72ce8df904b5.js","contact/recovery-support-v2.6b076d1b72ce8df904b5.js.map"],"contact/sidebar":["contact/sidebar.f656df78b2091c8da4d8.js","contact/sidebar.f656df78b2091c8da4d8.js.map"],"debug/badstatus":["debug/badstatus.1de5094f3e6a9b99c36d.js","debug/badstatus.1de5094f3e6a9b99c36d.js.map"],"debug/detail":["debug/detail.776dd808fa58d32672a7.js","debug/detail.776dd808fa58d32672a7.js.map"],"debug/failcomponent":["debug/failcomponent.ae7923483c75cca10fdf.js","debug/failcomponent.ae7923483c75cca10fdf.js.map"],"dev/choose-template":["dev/choose-template.0b7cf2c2179df20d3fe7.js","dev/choose-template.0b7cf2c2179df20d3fe7.js.map"],"dsr/dsr-export":["dsr/dsr-export.79524fae1e1d404b8626.js","dsr/dsr-export.79524fae1e1d404b8626.js.map"],"egg/egg":["egg/egg.d344471ef4f8a3a4b35e.js","egg/egg.d344471ef4f8a3a4b35e.js.map"],"errors/bad-request":["errors/bad-request.04f47df3f894a59d2ba8.js","errors/bad-request.04f47df3f894a59d2ba8.js.map"],"errors/not-found":["errors/not-found.d30e6bf9e464ad027451.js","errors/not-found.d30e6bf9e464ad027451.js.map"],"errors/server":["errors/server.4a0b63df0ef09bc42ed0.js","errors/server.4a0b63df0ef09bc42ed0.js.map"],"errors/tea-pot":["errors/tea-pot.02c8f951700ed9cca39e.js","errors/tea-pot.02c8f951700ed9cca39e.js.map"],"errors/template":["errors/template.39d816e653eb9347d070.js","errors/template.39d816e653eb9347d070.js.map"],"flatpage/flatpage":["flatpage/flatpage.50d707cbe94bd794d7ad.js","flatpage/flatpage.50d707cbe94bd794d7ad.js.map"],"homepage/homepage":["homepage/homepage.94c4cd79e3f3b0cf698f.js","homepage/homepage.94c4cd79e3f3b0cf698f.js.map"],"homepage/homepage-logged-in":["homepage/homepage-logged-in.6e266a3860a707cb4f8b.js","homepage/homepage-logged-in.6e266a3860a707cb4f8b.js.map"],"orgs/create":["orgs/create.d00b894dfeff60f6f09a.js","orgs/create.d00b894dfeff60f6f09a.js.map"],"orgs/detail":["orgs/detail.e51c4b342f71b8f536f5.js","orgs/detail.e51c4b342f71b8f536f5.js.map"],"orgs/invite":["orgs/invite.e3c8b2c22c5bd2d2301c.js","orgs/invite.e3c8b2c22c5bd2d2301c.js.map"],"orgs/tfa-enforced":["orgs/tfa-enforced.7d10b30d6fb9f85a4b9d.js","orgs/tfa-enforced.7d10b30d6fb9f85a4b9d.js.map"],"orgs/upgrade":["orgs/upgrade.73eb828ed46f63a37de5.js","orgs/upgrade.73eb828ed46f63a37de5.js.map"],"package-list/package-list":["package-list/package-list.03a9b00f029a35abc59b.js","package-list/package-list.03a9b00f029a35abc59b.js.map"],"package/delete-package":["package/delete-package.0e8a8d4066805ee37ba1.js","package/delete-package.0e8a8d4066805ee37ba1.js.map"],"package/deprecate-package":["package/deprecate-package.7c2b91a268103f716f57.js","package/deprecate-package.7c2b91a268103f716f57.js.map"],"package/error-message-package":["package/error-message-package.fb56c6df5c7fa8925b71.js","package/error-message-package.fb56c6df5c7fa8925b71.js.map"],"package/package":["package/package.0958c68d54da31c5d875.js","package/package.0958c68d54da31c5d875.js.map"],"profile/profile":["profile/profile.d1f12ab781523e122fd9.js","profile/profile.d1f12ab781523e122fd9.js.map"],"recovery-codes/show":["recovery-codes/show.2e2849d510004b535268.js","recovery-codes/show.2e2849d510004b535268.js.map"],"search/search":["search/search.634d21be6ef9c38ffbf7.js","search/search.634d21be6ef9c38ffbf7.js.map"],"searchv2/search":["searchv2/search.7547af08116f24d09906.js","searchv2/search.7547af08116f24d09906.js.map"],"settings/change-password":["settings/change-password.65293989a2bf07659fab.js","settings/change-password.65293989a2bf07659fab.js.map"],"settings/delete-account":["settings/delete-account.18f07696dc2142a3f122.js","settings/delete-account.18f07696dc2142a3f122.js.map"],"settings/email":["settings/email.99e7dcdb2b503c6f65b4.js","settings/email.99e7dcdb2b503c6f65b4.js.map"],"settings/memberships":["settings/memberships.a94ffe24356097b24e34.js","settings/memberships.a94ffe24356097b24e34.js.map"],"settings/packages":["settings/packages.dc2ed426ee6f9ab953c7.js","settings/packages.dc2ed426ee6f9ab953c7.js.map"],"settings/profile":["settings/profile.7407d2dea9a5e81b6f81.js","settings/profile.7407d2dea9a5e81b6f81.js.map"],"teams/create":["teams/create.4645f75c4a163e383c1c.js","teams/create.4645f75c4a163e383c1c.js.map"],"teams/detail":["teams/detail.1737f413ba412903a31e.js","teams/detail.1737f413ba412903a31e.js.map"],"teams/list":["teams/list.675e3d846dadd45bd975.js","teams/list.675e3d846dadd45bd975.js.map"],"teams/packages":["teams/packages.17ceed80b4b2f15d9fdf.js","teams/packages.17ceed80b4b2f15d9fdf.js.map"],"teams/users":["teams/users.30c74e91a221032a77d5.js","teams/users.30c74e91a221032a77d5.js.map"],"tfa/additional-options":["tfa/additional-options.925102a4f64d5f0e7ee9.js","tfa/additional-options.925102a4f64d5f0e7ee9.js.map"],"tfa/enable":["tfa/enable.3c6779277e8c1b22cd8c.js","tfa/enable.3c6779277e8c1b22cd8c.js.map"],"tfa/list":["tfa/list.1aff1464b6de13b88bc7.js","tfa/list.1aff1464b6de13b88bc7.js.map"],"tfa/recovery-codes":["tfa/recovery-codes.a3d212fbca5e1d5340bf.js","tfa/recovery-codes.a3d212fbca5e1d5340bf.js.map"],"tfa/security-key-list":["tfa/security-key-list.f2bbb09dc97c41c81d5f.js","tfa/security-key-list.f2bbb09dc97c41c81d5f.js.map"],"tfa/showTFAQRCode":["tfa/showTFAQRCode.cd5cd1f111367ad58d80.js","tfa/showTFAQRCode.cd5cd1f111367ad58d80.js.map"],"tfa/showTFASuccess":["tfa/showTFASuccess.592bef5c6a6c29198c44.js","tfa/showTFASuccess.592bef5c6a6c29198c44.js.map"],"tfa/tfa-disable":["tfa/tfa-disable.f34ee1512688be89995a.js","tfa/tfa-disable.f34ee1512688be89995a.js.map"],"tfa/tfa-mode-selection":["tfa/tfa-mode-selection.914596b0b39aa7ebbc4b.js","tfa/tfa-mode-selection.914596b0b39aa7ebbc4b.js.map"],"tfa/tfa-password-entry":["tfa/tfa-password-entry.e60eb4b2d9189606ec34.js","tfa/tfa-password-entry.e60eb4b2d9189606ec34.js.map"],"tfa/totp":["tfa/totp.74c4cb8a9e68a54db72c.js","tfa/totp.74c4cb8a9e68a54db72c.js.map"],"tokens/create":["tokens/create.5414ff94251c848dc901.js","tokens/create.5414ff94251c848dc901.js.map"],"tokens/create-gat":["tokens/create-gat.8513abe99617319bfa23.js","tokens/create-gat.8513abe99617319bfa23.js.map"],"tokens/gat-details":["tokens/gat-details.a1f7e70ebc8f3250d165.js","tokens/gat-details.a1f7e70ebc8f3250d165.js.map"],"tokens/gat/allowed-ip-ranges-input":["tokens/gat/allowed-ip-ranges-input.791f1c60453a65ee7b82.js","tokens/gat/allowed-ip-ranges-input.791f1c60453a65ee7b82.js.map"],"tokens/gat/constants":["tokens/gat/constants.c1d240b65fa21a482335.js","tokens/gat/constants.c1d240b65fa21a482335.js.map"],"tokens/gat/divider":["tokens/gat/divider.8a57d4da9e05b7d8d11b.js","tokens/gat/divider.8a57d4da9e05b7d8d11b.js.map"],"tokens/gat/expiration-days-input":["tokens/gat/expiration-days-input.7c4acaaf2847fbaa5c43.js","tokens/gat/expiration-days-input.7c4acaaf2847fbaa5c43.js.map"],"tokens/gat/gat-expiration":["tokens/gat/gat-expiration.8723ab9bd6b760a18a08.js","tokens/gat/gat-expiration.8723ab9bd6b760a18a08.js.map"],"tokens/gat/gat-input":["tokens/gat/gat-input.880fdad4cd129763ed91.js","tokens/gat/gat-input.880fdad4cd129763ed91.js.map"],"tokens/gat/organizations-input":["tokens/gat/organizations-input.31a089d45205c4df7d63.js","tokens/gat/organizations-input.31a089d45205c4df7d63.js.map"],"tokens/gat/organizations-section":["tokens/gat/organizations-section.5000e95cd864cd836844.js","tokens/gat/organizations-section.5000e95cd864cd836844.js.map"],"tokens/gat/packages-and-scopes-input":["tokens/gat/packages-and-scopes-input.f529abc764ac172688e8.js","tokens/gat/packages-and-scopes-input.f529abc764ac172688e8.js.map"],"tokens/gat/packages-and-scopes-section":["tokens/gat/packages-and-scopes-section.f40d2902fea20d2e8dfd.js","tokens/gat/packages-and-scopes-section.f40d2902fea20d2e8dfd.js.map"],"tokens/gat/permissions-input":["tokens/gat/permissions-input.9187d368a61870ca6756.js","tokens/gat/permissions-input.9187d368a61870ca6756.js.map"],"tokens/gat/section":["tokens/gat/section.22e3e32d4745b51dc57c.js","tokens/gat/section.22e3e32d4745b51dc57c.js.map"],"tokens/gat/section-heading":["tokens/gat/section-heading.6a97c6f3a22e91f123c7.js","tokens/gat/section-heading.6a97c6f3a22e91f123c7.js.map"],"tokens/gat/selected-items":["tokens/gat/selected-items.f48fcf5071f15400da12.js","tokens/gat/selected-items.f48fcf5071f15400da12.js.map"],"tokens/gat/utils":["tokens/gat/utils.a81a368fd699d790cc83.js","tokens/gat/utils.a81a368fd699d790cc83.js.map"],"tokens/generate-token":["tokens/generate-token.f42fe92aeb2b0da3d8db.js","tokens/generate-token.f42fe92aeb2b0da3d8db.js.map"],"tokens/list":["tokens/list.70431312b6a70e600c2e.js","tokens/list.70431312b6a70e600c2e.js.map"],"vouchers/view":["vouchers/view.617c38480b3a48c14719.js","vouchers/view.617c38480b3a48c14719.js.map"]},"hash":"b79be12adf7a5316de1e","name":"package/package","containerId":"app","headerName":"x-spiferack","publicPath":"https://static-production.npmjs.com/"}</script><script crossorigin="anonymous" src="https://static-production.npmjs.com/commons.b79be12adf7a5316de1e.js"></script> <script crossorigin="anonymous" src="https://static-production.npmjs.com/minicssextractbug.d20b6beec9f84f3c51f4.js"></script> <script crossorigin="anonymous" src="https://static-production.npmjs.com/package/package.0958c68d54da31c5d875.js"></script> </body> </html>