Packages

zod

4.6.7 · 12 Oct 2026MIT468.6M / weekRepositoryHomepagenpmAtom feed

Your version

4.2.0

15 Dec 2025Where it was published

4.6.7 is the newest release of 4.x.

Summary· from the note as AI read it

No actionNothing to change: 5 new, 0 fixed.

New

  • Implement Standard JSON Schema
  • Implement z.fromJSONSchema()
  • Implement z.xor()
  • Implement z.looseRecord()
  • Add .toJSONSchema() method

In short

6 new1 internal

Security

1 advisory affects 4.2.0; 4.6.6 fixes them

Release note

Features

Implement Standard JSON Schema

#134

Implement z.fromJSONSchema()

const jsonSchema = {
  type: "object",
  properties: {
    name: { type: "string" },
    age: { type: "number" }
  },
  required: ["name"]
};

const schema = z.fromJSONSchema(jsonSchema);

Implement z.xor()

const schema = z.xor(
  z.object({ type: "user", name: z.string() }),
  z.object({ type: "admin", role: z.string() })
);
// Exactly one of the schemas must match

Implement z.looseRecord()

const schema = z.looseRecord(z.string(), z.number());
// Allows additional properties beyond those defined

Commits

  • Update docs for JSON Schema conversion of z.undefined()

  • Add .toJSONSchema() method

  • Add z.fromJSONSchema(), z.looseRecord(), z.xor()

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.