
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
cockpit-orm
Advanced tools
npm install cockpit-orm
# or
yarn add cockpit-orm
The Entry class is for mapping one single entry of a collection.
Entry.slugField to use a handy slug that will identify this Entry instead of _id. When the slugField is undefined the _id field will be used.import { Entry } from "cockpit-orm";
import schema from "../schemas/Portfolioitems.json";
import cockpit from "../"; // Initiated CockpitSDK instance.
class Post extends Entry {
static cockpit = cockpit;
static slugField = "title_slug";
static schema = {
// Cockpit collection schema.
name: "post",
fields: [{ name: "title", options: { slug: true } }, { name: "body" }]
};
}
async () => {
const post = new Post();
post.setSlug("hello-work");
await post.sync(); // Fetches cockpit and fill all other fields.
post.get("title");
post.get("body");
};
const post = new Post({ title: "Hello" });
post.get("title"); // Hello
post.has("body"); // false
post.save(); // POST to cockpit
async () => {
const post = new Post();
post.setSlug("hello-work");
await post.sync(); // Fetches cockpit and fill all other fields.
post.set("title", "New title");
post.set("body", "New body");
await post.save(); // POST to cockpit
};
The Collection class is for fetching the whole collection entries.
import { Collection } from "cockpit-orm";
import Entry from "./Entry";
import cockpit from "../"; // Initiated CockpitSDK instance.
export default class PostCollection extends Collection {
static collectionName = "Posts";
static slugField = "title_slug";
static cockpit = cockpit;
}
const posts = new PostCollection();
const entries = posts.getEntries();
export default class PostCollection extends Collection {
//...
getPublished(fields) {
return this.getObject(fields, { filter: { published: true } });
}
}
const entries = new PostCollection().getPublished();
FAQs
ORM for Cockpit Headless CMS
We found that cockpit-orm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.