@jsonresume/schema
Advanced tools
Comparing version 1.1.2 to 1.2.0
The MIT License (MIT) | ||
Copyright © 2014 JSON Resume | ||
Copyright © 2024 JSON Resume | ||
@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
{ | ||
"name": "@jsonresume/schema", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"description": "JSON Resume Schema", | ||
@@ -5,0 +5,0 @@ "private": false, |
@@ -18,4 +18,11 @@ # JSON Resume Schema | ||
This enforces that the schema package, always has the official stable release of the schema. | ||
This enforces that the schema package always has the official stable release of the schema. | ||
### Homepage and Registry | ||
If you are looking for the homepage, registry, tooling or themes, see the JSON Resume monorepo | ||
[@jsonresume/jsonresume.org](https://github.com/jsonresume/jsonresume.org/) | ||
### Getting started | ||
@@ -30,5 +37,5 @@ | ||
```js | ||
const resumeSchema = require("@jsonresume/schema"); | ||
import resumeSchema from '@jsonresume/schema'; | ||
resumeSchema.validate( | ||
{ name: "Thomas" }, | ||
{ basics: { name: "Thomas" } }, | ||
function (err, report) { | ||
@@ -47,8 +54,8 @@ if (err) { | ||
More likely | ||
Or against a full `resume.json` | ||
```js | ||
var fs = require("fs"); | ||
var resumeSchema = require("resume-schema"); | ||
var resumeObject = JSON.parse(fs.readFileSync("resume.json", "utf8")); | ||
import fs = require('fs'); | ||
import schema from 'resume-schema'; | ||
const resumeObject = JSON.parse(fs.readFileSync('./resume.json', 'utf8')); | ||
resumeSchema.validate(resumeObject); | ||
@@ -93,2 +100,8 @@ ``` | ||
The JSON Job schema is available from: | ||
```js | ||
require("resume-schema").jobSchema; | ||
``` | ||
### Other resume standards | ||
@@ -95,0 +108,0 @@ |
@@ -1,7 +0,8 @@ | ||
"use strict"; | ||
var schema = require("./schema"); | ||
var Validator = require("jsonschema").Validator; | ||
'use strict'; | ||
const schema = require('./schema'); | ||
const jobSchema = require('./job-schema'); | ||
const Validator = require('jsonschema').Validator; | ||
function validate(resumeJson, callback) { | ||
var v = new Validator(); | ||
const v = new Validator(); | ||
@@ -19,3 +20,4 @@ const validation = v.validate(resumeJson, schema); | ||
validate: validate, | ||
schema: schema, | ||
schema, | ||
jobSchema, | ||
}; |
32079
873
107