@averagehelper/resume-schema
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

JSON Resume Schema

GitHub Releases NPM Release

Standard, Specification, Schema

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

My goals for this project:

  • [x] Add a basics.pronouns field
  • [x] Basic TypeScript declarations around exported structures
  • [x] Generate a TypeScript interface from the JSON schema, to make generic theme templates easier to construct
  • [x] Port to TypeScript
  • [x] 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

Dependents (0)

Package Sidebar

Install

npm i @averagehelper/resume-schema

Weekly Downloads

2

Version

1.3.0

License

MIT

Unpacked Size

39.4 kB

Total Files

8

Last publish

Collaborators

  • averagehelper