Migration Guide

simple-odf alternative: migrate to odf-kit

simple-odf was abandoned in 2021. odf-kit is a maintained TypeScript library that generates proper .odt files with tables, images, page layout, and a template engine. Works in Node.js and browsers. Here's how to migrate.

What happened to simple-odf?

simple-odf was the only JavaScript library for creating OpenDocument files. It was last updated in 2021 and has known limitations that were never addressed: it generates flat XML files (.fodt) instead of proper ZIP-packaged .odt files, it has no support for tables, images, or page layout, and its npm package hasn't been updated in years.

If you're using simple-odf today, your generated documents are flat XML files that some applications handle inconsistently. A proper .odt file is a ZIP package containing XML, images, and metadata — which is what odf-kit generates.

Feature comparison

Featureodf-kitsimple-odf
Maintained Active (2026) Abandoned (2021)
Output format Proper .odt ZIP Flat XML (.fodt)
Template engine Loops, conditionals, dot notation Not supported
Tables Widths, borders, merging Not supported
Images Embedded in ZIP Not supported
Page layout Margins, headers, footers Not supported
Lists Bullet & numbered, nestedPartial
Hyperlinks External + internal bookmarksPartial
TypeScript
Browser support Node.js + browsers Node.js only
Dependencies1 (fflate, 0 transitive)0
Tests222~50

Migration: side-by-side comparison

The API styles differ, but the concepts map directly. Here's how common operations translate:

Creating a document and adding text:

simple-odf
const { TextDocument } = require('simple-odf');
const doc = new TextDocument();
const body = doc.getBody();
body.addHeading('Hello');
body.addParagraph('World');
doc.saveFlat('doc.fodt');
odf-kit
import { OdtDocument } from "odf-kit";
import { writeFileSync } from "fs";
const doc = new OdtDocument();
doc.addHeading("Hello", 1);
doc.addParagraph("World");
const bytes = await doc.save();
writeFileSync("doc.odt", bytes);

Key differences:

What odf-kit adds beyond simple-odf

After migrating your existing code, you get access to features simple-odf never had:

Installation

Remove simple-odf and install odf-kit:

# Remove old library
npm uninstall simple-odf

# Install odf-kit
npm install odf-kit

Make sure your package.json has "type": "module" (odf-kit is ESM-only) and you're running Node.js 18 or later.

Need help migrating?

If you run into issues, open an issue on GitHub. We're happy to help with specific migration questions.

Ready to migrate from simple-odf?

$ npm install odf-kit