1.3.0 • Published 3 months ago

@averagehelper/resume-schema v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

JSON Resume Schema

GitHub Releases NPM Release

Standard, Specification, Schema

!NOTE This is a fork of jsonresume/resume-schema.

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

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

This package requires Node 10 or newer.

npm install @averagehelper/resume-schema

Usage

Basic:

const resumeSchema = require("@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.

Other resume standards

1.3.0

3 months ago

1.2.1

3 months ago

1.2.0

3 months ago