@jsonresume/schema 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/README.md +20 -7
- package/package.json +1 -1
- package/validator.js +7 -5
package/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -15,7 +15,14 @@ The current working version of the schema is `v1.0.0` that is represented by the
|
|
|
15
15
|
|
|
16
16
|
All PR's for the next version should be made against the `develop` branch.
|
|
17
17
|
|
|
18
|
-
This enforces that the schema package
|
|
18
|
+
This enforces that the schema package always has the official stable release of the schema.
|
|
19
|
+
|
|
20
|
+
### Homepage and Registry
|
|
21
|
+
|
|
22
|
+
If you are looking for the homepage, registry, tooling or themes, see the JSON Resume monorepo
|
|
23
|
+
|
|
24
|
+
[@jsonresume/jsonresume.org](https://github.com/jsonresume/jsonresume.org/)
|
|
25
|
+
|
|
19
26
|
|
|
20
27
|
### Getting started
|
|
21
28
|
|
|
@@ -26,9 +33,9 @@ npm install --save @jsonresume/schema
|
|
|
26
33
|
To use
|
|
27
34
|
|
|
28
35
|
```js
|
|
29
|
-
|
|
36
|
+
import resumeSchema from '@jsonresume/schema';
|
|
30
37
|
resumeSchema.validate(
|
|
31
|
-
{ name: "Thomas" },
|
|
38
|
+
{ basics: { name: "Thomas" } },
|
|
32
39
|
function (err, report) {
|
|
33
40
|
if (err) {
|
|
34
41
|
console.error("The resume was invalid:", err);
|
|
@@ -42,12 +49,12 @@ resumeSchema.validate(
|
|
|
42
49
|
);
|
|
43
50
|
```
|
|
44
51
|
|
|
45
|
-
|
|
52
|
+
Or against a full `resume.json`
|
|
46
53
|
|
|
47
54
|
```js
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
55
|
+
import fs = require('fs');
|
|
56
|
+
import schema from 'resume-schema';
|
|
57
|
+
const resumeObject = JSON.parse(fs.readFileSync('./resume.json', 'utf8'));
|
|
51
58
|
resumeSchema.validate(resumeObject);
|
|
52
59
|
```
|
|
53
60
|
|
|
@@ -87,6 +94,12 @@ Pull requests titles should be formatted as such
|
|
|
87
94
|
|
|
88
95
|
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`.
|
|
89
96
|
|
|
97
|
+
The JSON Job schema is available from:
|
|
98
|
+
|
|
99
|
+
```js
|
|
100
|
+
require("resume-schema").jobSchema;
|
|
101
|
+
```
|
|
102
|
+
|
|
90
103
|
### Other resume standards
|
|
91
104
|
|
|
92
105
|
- [HR-XML](https://schemas.liquid-technologies.com/HR-XML/2007-04-15/)
|
package/package.json
CHANGED
package/validator.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
const schema = require('./schema');
|
|
3
|
+
const jobSchema = require('./job-schema');
|
|
4
|
+
const Validator = require('jsonschema').Validator;
|
|
4
5
|
|
|
5
6
|
function validate(resumeJson, callback) {
|
|
6
|
-
|
|
7
|
+
const v = new Validator();
|
|
7
8
|
|
|
8
9
|
const validation = v.validate(resumeJson, schema);
|
|
9
10
|
|
|
@@ -16,5 +17,6 @@ function validate(resumeJson, callback) {
|
|
|
16
17
|
|
|
17
18
|
module.exports = {
|
|
18
19
|
validate: validate,
|
|
19
|
-
schema
|
|
20
|
+
schema,
|
|
21
|
+
jobSchema,
|
|
20
22
|
};
|