An object-relational mapping library for Cockpit Headless CMS (v0.4.0, stable). Provides Entry and Collection classes to manage Cockpit content without manually fetching the Cockpit API. Depends on cockpit-sdk ^0.8.3. Differentiates by offering a schema-driven, class-based ORM pattern similar to ActiveRecord, with features like slug-based syncing, save/update via POST, and custom collection methods. Useful for Node.js and browser environments.
npm install cockpit-ormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to extend Entry and Collection, sync an entry by slug, and get a field value.
Ensure the static schema matches the Cockpit collection schema verbatim, including field names and types.
Always sync() before reading fields, or check has() before get().
Use sync() to fetch existing data, modify, then save() to create a new version. There is no PUT/PATCH support.
N/A
Replace 'import cockpitOrm from "cockpit-orm"' with 'import { Entry, Collection } from "cockpit-orm"'Add static schema = { name: 'YourCollectionName', fields: [...] } to the Entry subclassEnsure sync() is called and awaited before get(), or use set() to set fields locally first