/resume-schema

JSON-Schema is used here to define and validate our proposed resume json

Primary LanguageJavaScriptMIT LicenseMIT

JSON Resume Schema

GitHub Releases NPM Release

Standard, Specification, Schema

Note

This is a fork of jsonresume/resume-schema. Learn more at jsonresume.org.

My goals for this project:

  • Add a basics.pronouns field
  • Basic TypeScript declarations around exported structures
  • Generate a TypeScript interface from the JSON schema, to make generic theme templates easier to construct
  • Port to TypeScript
  • Add a Promise-compatible interface for validate
  • Clean up and update the changelog, perhaps using the keep a changelog standard
  • Simplify unit tests. Surely there's a way to generate each valid/invalid test case from the existing well-labeled valid/invalid test fixtures!
  • Build both legacy CJS and modern ESM bundles
  • Switch to tab indentation for accessibility
  • A real actual website! Need to work out whether one is even necessary, and what domain name to use. We have jsonresume.average.name for now, and that simply redirects here.

I might add more as ideas come to me. I plan to open upstream pull requests once in a while. I'm not sure all of my changes will make it upstream, but a gal can try!

A read-only mirror exists at my git forge.

Getting started

npm install @averagehelper/resume-schema

Usage

Basic:

import fs from "node:fs";
import resumeSchema from "@averagehelper/resume-schema";
const resume = JSON.parse(fs.readFileSync("resume.json", "utf8"));

try {
  await resumeSchema.validate(resume);
  console.log("Resume validated successfully!");
} catch (error) {
  console.error("The resume was invalid:", error);
}

Simplified:

const fs = require("node:fs");
const resumeSchema = require("@averagehelper/resume-schema");
const resume = JSON.parse(fs.readFileSync("resume.json", "utf8"));

const resumeObject = await resumeSchema.validated(resume); // throws if invalid

Callback:

const fs = require("node:fs");
const resumeSchema = require("@averagehelper/resume-schema");
const resume = JSON.parse(fs.readFileSync("resume.json", "utf8"));

resumeSchema.validate(resume, function (err, result) {
  if (err) {
    console.error("The resume was invalid:", error);
  } else {
    console.log("Resume validated successfully:", result);
  }
});

ESM:

import fs from "node:fs";
import { validated } from "@averagehelper/resume-schema";
const resume = JSON.parse(fs.readFileSync("resume.json", "utf8"));

const resumeObject = await validated(resume); // throws if invalid

TypeScript:

import fs from "node:fs";
import type { ResumeSchema } from "@averagehelper/resume-schema";
import { validated } from "@averagehelper/resume-schema";
const resume = JSON.parse(fs.readFileSync("resume.json", "utf8"));

const resumeObject: ResumeSchema = await validated(resume); // throws if invalid

The JSON Resume schema is available from:

import { schema } from "@averagehelper/resume-schema";

Contribute

We encourage anyone who's interested in participating in the formation of this standard to join the discussions here on GitHub. Also feel free to fork this project and submit new ideas to add to the JSON Resume Schema standard. To make sure all formatting is kept in check, please install the EditorConfig plugin for your editor of choice.

Versioning

JSON Resume Schema adheres to Semantic Versioning 2.0.0. If there is a violation of this scheme, report it as a bug. Specifically, if a patch or minor version is released and breaks backward compatibility, that version should be immediately yanked and/or a new version should be immediately released that restores compatibility. Any change that breaks the public API will only be introduced at a major-version release. As a result of this policy, you can (and should) specify any dependency on JSON Resume Schema by using the Pessimistic Version Constraint with two digits of precision.

We use automatic semver system.

Pull requests titles should be formatted as such

"fix: added something" - will bump the patch version
"feat: added something" - will bump the minor version

major version bumps will be few and far between for this schema.

Job Description Schema

A draft schema for job descriptions is available in this project as well. It is not yet finalized, but we encourage you to check it out and provide feedback. See job-schema.json and sample.job.json.

The JSON Job schema is available from:

require("@averagehelper/resume-schema").jobSchema;

Other resume standards