json-schema-default

JSON →
library 1.0.2 ·javascript
verified Jun 7, 2026

Generate an object based on default values defined in a JSON Schema. This package extracts only the default values from a schema, ignoring 'required' constraints, making it suitable for pre-filling forms or merging with existing data to ensure defaults are present. v1.0.2 targets Node 18+ and ships TypeScript types. It differs from json-schema-empty (which respects 'required' and creates placeholder values) by focusing strictly on explicit defaults. Release cadence: low (single stable release as of 2024). Key alternatives: AJV's assignDefaults, json-schema-empty, json-schema-fill-defaults.