Skip to content

cupertino-filesPages, Numbers, and Keynote. In TypeScript.

Open, edit, and save Apple's document formats anywhere JavaScript runs. No Mac required. An open reverse-engineering, still under way—designed so every byte you don't touch comes back exactly.

A cardboard tray of apples, each wearing a cupertino-files fruit sticker

Say hello ​

sh
npm install cupertino-files
ts
import { readFileSync, writeFileSync } from "node:fs";
import { PagesDocument } from "cupertino-files";

const doc = PagesDocument.load(new Uint8Array(readFileSync("Report.pages")));

doc.appendParagraph("hello");   // the traditional first word
doc.replaceText("2024", "2025");
doc.sections()[0].setHeaderText("Confidential");

writeFileSync("Report 2025.pages", doc.save());

Open the result in Pages. It opens—and if yours ever doesn't, that is a bug report we genuinely want. (How we know it usually does.)

one more thing … ​

This isn't only a library. It's the format, written down: a specification measured from real documents, a conformance suite any implementation can test against, and the recovered schemas with their provenance. If you're building iWork support in another language—or another decade—the knowledge is yours too.

MIT licensed. Independently made — not by Apple in California. Not affiliated with or endorsed by Apple Inc.