Date:
prev next ·
Thread:
first prev next last
Hi,
I wanted to let the ODF Toolkit community know about a new open-source project that complements
your work in a different language ecosystem.
odf-kit is a TypeScript library for generating ODF documents (.odt files) in Node.js. It's
write-only — focused purely on document generation, not reading or parsing. It targets
JavaScript/TypeScript developers who need to produce ODF output programmatically.
To be clear, this is a very different project from ODF Toolkit. ODF Toolkit is a mature,
full-featured Java library for both reading and writing ODF. odf-kit is a lightweight
generation-only tool for the JS ecosystem, where no maintained option existed — the only prior
library (simple-odf) was abandoned in 2021 and lacked table support.
What odf-kit does today (v0.1.0):
- Generates spec-compliant ODF 1.2 .odt files (ZIP packaged, proper namespaces and manifest)
- Text with formatting (bold, italic, underline, fonts, colors, highlights)
- Tables with borders, backgrounds, column widths, and cell merging
- Page layout (size, margins, orientation, headers, footers, page numbers)
- Bullet and numbered lists with nesting
- Embedded images, hyperlinks, and bookmarks
- Single runtime dependency, full TypeScript type definitions, 102 tests
The API is designed for developers who don't know the ODF spec:
typescript
import
{
OdtDocument
}
from
"odf-kit"
;
const
doc
=
new
OdtDocument
(
)
;
doc
.
addHeading
(
"Report"
,
1
)
;
doc
.
addParagraph
(
"Revenue exceeded expectations."
)
;
doc
.
addTable
(
[
[
"Division"
,
"Revenue"
]
,
[
"North"
,
"$2.1M"
]
,
[
"South"
,
"$1.8M"
]
,
]
,
{
border
:
"0.5pt solid #000000"
}
)
;
const
bytes
=
await
doc
.
save
(
)
;
- npm: https://www.npmjs.com/package/odf-kit
- GitHub: https://github.com/GitHubNewbie0/odf-kit
- License: Apache 2.0
ODS, ODP, and ODG support are planned.
I have a lot of respect for the work the ODF Toolkit team has done. If it would be appropriate, I'd
be grateful to be listed as a related project on odftoolkit.org for developers working in the
JavaScript ecosystem. Either way, I'd welcome any feedback from people who know the ODF
specification as well as your community does.
Thanks for your time.
Scott GitHub: GitHubNewbie0
--
To unsubscribe e-mail to: dev+unsubscribe@odftoolkit.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.odftoolkit.org/dev/
Privacy Policy: https://www.documentfoundation.org/privacy
Context
- [dev] [DISCUSS] New JavaScript/TypeScript library for ODF document generation · Scott Wirth
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.