Registry / productivity / resume-schema

resume-schema

JSON →
library1.0.1jsnpmunverified

Standard JSON schema for resumes, providing a uniform structure for resume data exchange. Current stable version is 1.0.1, released sporadically. It validates resume JSON objects and includes a draft job description schema. Differentiates from other standards (HR-XML, Europass) by being JSON-based and simple.

npm install resume-schema
INSTALL
IMPORT
SIG · RESUME-SCHEMA
R
resume-schema
productivityjavascriptv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

validate
import { validate } from 'resume-schema'
const { validate } = require('resume-schema')
ESM imports work in Node >=20; CJS require() still works but ESM is preferred.
schema
import { schema } from 'resume-schema'
const schema = require('resume-schema').schema
Direct access to the raw schema object.
default
import resumeSchema from 'resume-schema'
const resumeSchema = require('resume-schema')
Default export is an object with validate and schema properties. CJS require returns this object.
validate (callback style)
import { validate } from 'resume-schema'; validate(resume, (err, report) => {}, (err) => {})
validate(resume, function(err, report) {})
The callback signature is (err, report) for first callback, and (err) optional for second callback. Missing second callback may cause unexpected error handling.

Validates a JSON resume object using the schema's validate function with callbacks.

import { validate } from 'resume-schema'; const resume = { basics: { name: 'John Doe', label: 'Developer' }, work: [ { company: 'Company', position: 'Software Engineer', startDate: '2020-01-01', endDate: '2023-01-01' } ], education: [ { institution: 'University', area: 'Computer Science', studyType: 'Bachelor', startDate: '2016-09-01', endDate: '2020-06-01' } ] }; validate(resume, (err, report) => { if (err) { console.error('Validation failed:', err); } else { console.log('Resume is valid:', report); } }, (err) => { console.error('Validation error:', err); });
Debug
Known issues
deprecatedThe validate function with two callbacks is deprecated in favor of a single callback returning err and report.
fix
Use single callback: validate(resume, (err, report) => {...})
affects: >=1.0.0
gotchaThe schema property is mutable; modifying it affects all subsequent validations.
fix
Copy the schema before modifying: const schemaCopy = JSON.parse(JSON.stringify(schema))
affects: >=0.2.0
gotchaDate fields must be in ISO 8601 format (YYYY-MM-DD), otherwise validation will fail.
fix
Use '2023-01-01' format for date fields.
affects: >=1.0.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM: require() of ES Module /path/to/resume-schema/index.js from node_modules not supported.
Using require() in a CommonJS file when the package is ESM-only (Node >=20).
fix
Use import instead of require, or rename file to .cjs
TypeError: resumeSchema.validate is not a function
Incorrect import: using default import but expecting a function.
fix
Use import { validate } from 'resume-schema'
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
21 hits · last 30 days
node
18
OpenAI (training)
1
Resources
resume-schema — npm install resume-schema · libregistry