@3kles/3kles-exceljs
v1.0.1
Published
3KLES ExcelJS - XLSX and CSV workbook library with asynchronous streaming
Readme
3KLES ExcelJS
3KLES ExcelJS reads and writes XLSX and CSV workbooks. It preserves the ExcelJS
document and streaming APIs and adds a Node.js streaming writer that propagates
backpressure. The sources, tests, and tools are in TypeScript. Webpack builds
the native ES2015 (ES6) distribution in dist/ by default.
The current package is @3kles/[email protected], maintained by 3Kles Lab under
the MIT license. To use this unpublished version, install the local tarball
following the installation guide.
The package is based on @protobi/[email protected].
Provenance and attributions.
Development
npm ci
npm run build
npm test
npm run check:generatedThe build checks TypeScript and compiles the distributions with Webpack into
dist/. Compiled tool and benchmark workers live in build/. The build also
generates the historical lib/** and excel.js compatibility entries at the
repository root. These generated files are ignored by Git; authored sources
remain under src/.
npm test runs the native and ES5 suites. npm run test:native rebuilds and
runs the unit, integration, end-to-end, TypeScript, browser, and distribution
tests. npm run test:es5 runs the ES5 suite separately. test:all is an alias
for npm test.
The automated and manual tests live under test/. Benchmarks run separately
from the test suites, and one-off diagnostics live in tools/qualification/.
Development guide.
Local packaging
npm run package:dry-run
npm run package:pack
npm run test:package -- --browserThese commands package the repository root. After npm run build, direct
npm pack and npm publish also use the root, as in 3kles-corebe. The
manifest's files list selects the distribution contents; publication requires
no TypeScript compiler or build lifecycle hook. The qualification command
installs the resulting tarball into isolated test projects and can also verify
the browser bundles. The package's Node, TypeScript, and browser entry points
are all under dist/.
Installation and migration.
Streaming API
| Operation | Existing API | Async API |
| --- | --- | --- |
| Writer | stream.xlsx.WorkbookWriter | stream.xlsx.AsyncWorkbookWriter |
| Row | row.commit() | await row.commitAsync() |
| Worksheet | worksheet.commit() | await worksheet.commitAsync() |
| Workbook | await workbook.commit() | await workbook.commit() |
Use AsyncWorkbookWriter with a new file path or an explicit Node.js
Writable. Write one worksheet at a time and await each row and worksheet
commit in order. The final workbook commit waits for the ZIP archive and
destination to finish. Use abort() to cancel and await cleanup. Existing
row.commit() and worksheet.commit() calls remain synchronous.
Async writer contract.
The async writer bounds its transport buffers. Shared strings, styles, large rows, and destinations that retain output in memory each have their own memory costs. Async writer migration.
