Registry / testing / jsck
library0.3.2jsnpmunverified

JSCK (JSON Schema Compiled checK) is a JSON Schema validator for Node.js that compiles schemas into efficient validation trees for performance. It supports JSON Schema drafts 3 and 4 with some caveats (e.g., no remote refs, no uniqueItems). Current stable version is 0.3.2. It is faster than many alternatives due to compilation, but is no longer actively maintained (last release in 2016). Key differentiators: compiles schema to functions, supports draft 3 and 4, but lacks modern draft 6/7/2019-09 support.

npm install jsck
INSTALL
IMPORT
SIG · JSCK
J
jsck
testingjavascriptv0.3.2
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.

default
import JSCK from 'jsck'
const JSCK = require('jsck')
Package uses CoffeeScript; ESM import works if bundler supports it. CommonJS require is also valid as the package exposes a CommonJS module.
draft4
new JSCK.draft4(schema)
new JSCK.draft4(schema, options)
Constructor takes only schema object; no options. Use for Draft 4 schemas.
draft3
new JSCK.draft3(schema)
new JSCK.draft3(schema, {})
Similar to draft4; no options argument.

Shows basic usage: create a Draft 4 validator, validate a document, and inspect errors.

import JSCK from 'jsck'; const schema = { type: 'object', properties: { name: { type: 'string' }, age: { type: 'integer', minimum: 0 } }, required: ['name'] }; const validator = new JSCK.draft4(schema); const validDoc = { name: 'Alice', age: 30 }; const result = validator.validate(validDoc); console.log(result.valid); // true const invalidDoc = { age: -5 }; const result2 = validator.validate(invalidDoc); console.log(result2.valid); // false console.log(result2.errors); // array of error objects
Debug
Known issues
deprecatedJSCK is no longer actively maintained.
fix
Consider switching to modern validators like Ajv or @cfworker/json-schema.
affects: >=0.0.0
gotchaNo support for remote $ref (refRemote).
fix
Use a validator that supports remote references, such as Ajv.
affects: *
gotchaNo support for uniqueItems.
fix
Use another validator if you need to enforce unique arrays.
affects: *
gotchaLimited support for 'id' attribute; only top-level and non-JSON-pointer fragments.
fix
Avoid complex 'id' usage or switch to a validator with full support.
affects: *
gotchaPackage is CoffeeScript; source requires CoffeeScript toolchain to develop.
fix
None for consumers; purely informational.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'jsck'
Package not installed or misspelled.
fix
Run 'npm install jsck' and ensure node_modules contains it.
TypeError: JSCK.draft4 is not a constructor
Incorrect import: using require as default instead of property.
fix
Use 'const JSCK = require('jsck');' then 'new JSCK.draft4(schema)'.
ValidationError: unknown format 'email'
JSCK does not support the 'email' format by default.
fix
Either avoid using 'format' or use a plugin/extend JSCK (see docs).
Upgrade
Version history
0.3.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
packagejsck
jsck — npm install jsck · libregistry