Skip to content

allindevelopers/resume-schema-zod

Repository files navigation

@allindevelopers/resume-schema-zod

A small collection of Zod schemas implementing the JSON Resume specification. This package provides TypeScript-friendly validation schemas based on the canonical JSON Resume schema (from https://github.com/jsonresume/resume-schema).

Features

  • Zod schemas for common JSON Resume sections (basics, work, education, skills, projects, etc.).
  • Top-level jsonResumeSchema and JsonResume type for validating/parsing full resume objects.
  • Small, dependency-light package — zod is a peer dependency.

Install

This repo is published under the package name @allindevelopers/resume-schema-zod.

Locally, install dependencies for development:

npm install

To use this package in another project, install zod and the package (when published):

npm install zod @allindevelopers/resume-schema-zod

Note: zod is listed as a peerDependency (v4+).

Usage

Import the schemas or types you need. Typical entry points exported from the package:

  • jsonResumeSchema — Zod schema for the whole resume object
  • JsonResume — TypeScript type inferred from jsonResumeSchema
  • Individual section schemas and types are exported from src/schemas/* (for example basicsSchema, educationItemSchema, workItemSchema, ...)

Example (TypeScript):

import {
	jsonResumeSchema,
	JsonResume,
} from "@allindevelopers/resume-schema-zod";
import { z } from "zod";

// Suppose `data` is an unknown object (from JSON.parse, an API, etc.)
const result = jsonResumeSchema.safeParse(data);

if (!result.success) {
	console.error("Invalid resume:", result.error.format());
} else {
	const resume: JsonResume = result.data;
	// resume is now typed and validated
}

Or use parse() when you want it to throw on invalid data:

const resume = jsonResumeSchema.parse(data);

Scripts

  • npm run build — compile TypeScript (tsc)
  • npm test — placeholder test script (no tests included)

Development

  • This project uses TypeScript and Prettier. See tsconfig.json and prettier.config.js.
  • Run npm run build to type-check / compile.

API / Exports

All public exports are re-exported from src/index.ts. Key exports include:

  • jsonResumeSchema (Zod schema)
  • JsonResume (inferred TypeScript type)
  • Per-section schemas: basicsSchema, workItemSchema, educationItemSchema, skillsItemSchema, etc.

Browse src/schemas to see exact schema shapes and names.

Contributing

Contributions are welcome. Small tasks that help: add tests, expand schema coverage, or provide examples.

If you're submitting changes:

  1. Fork the repo and create a branch.
  2. Run npm install and npm run build to validate.
  3. Open a PR with a clear description.

License

This repository is licensed under the MIT License (as declared in package.json). See the LICENSE file in the project root for the exact license text and terms.

About

A small collection of Zod schemas implementing the JSON Resume specification.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published