{"id":48245,"library":"jsen","title":"jsen - JSON Schema Validator","description":"jsen (JSON Sentinel) is a JSON Schema validator built for speed using dynamic code generation for V8 optimization. It supports JSON-Schema draft 4, remote and external schemas, custom formats and error messages, default value gathering, and greedy validation. The current stable version is 0.6.6 with low release cadence (last update 2019). It differentiates itself with performance benchmarks showing it faster than alternatives like z-schema, jsck, themis, and others. However, it lacks modern JSON Schema drafts (draft-06/07/2019-09), TypeScript types, and is not actively maintained.","status":"maintenance","version":"0.6.6","language":"javascript","source_language":"en","source_url":"https://github.com/bugventure/jsen","tags":["javascript","JSON","schema","validator","speed"],"install":[{"cmd":"npm install jsen","lang":"bash","label":"npm"},{"cmd":"yarn add jsen","lang":"bash","label":"yarn"},{"cmd":"pnpm add jsen","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package is CommonJS but can be used with ES modules; default import works in both.","wrong":"const jsen = require('jsen');","symbol":"jsen","correct":"import jsen from 'jsen'"},{"note":"jsen is a function, not a constructor.","wrong":"const validate = new jsen({ type: 'string' });","symbol":"validate","correct":"const validate = jsen({ type: 'string' });"},{"note":"Options like 'greedy' are boolean, not a mode string.","wrong":"const validate = jsen(schema, { mode: 'greedy' });","symbol":"jsen (with options)","correct":"const validate = jsen(schema, { greedy: true });"}],"quickstart":{"code":"import jsen from 'jsen';\n\nconst schema = {\n  type: 'object',\n  properties: {\n    name: { type: 'string' },\n    age: { type: 'number', minimum: 0 }\n  },\n  required: ['name', 'age']\n};\n\nconst validate = jsen(schema);\nconst valid = validate({ name: 'Alice', age: 30 });\nconsole.log(valid); // true\n\nconst invalid = validate({ name: 'Bob' });\nconsole.log(invalid); // false\nconsole.log(validate.errors); // [{ path: '', keyword: 'required', message: 'requires property \"age\"' }]","lang":"javascript","description":"Validates an object against a JSON Schema using jsen, showing success and failure with error details."},"warnings":[{"fix":"Consider switching to actively maintained validators like Ajv or jsonschema.","message":"Package is no longer actively maintained; last release in 2019","severity":"deprecated","affected_versions":">=0.6.6"},{"fix":"Ensure your schema conforms to draft 4, or use a validator that supports newer drafts.","message":"jsen only supports JSON Schema draft 4, not newer drafts (draft-06, draft-07, 2019-09, 2020-12)","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use a JSON Schema metaschema or a separate validation step to ensure your schema is correct.","message":"Malformed schema keywords are silently ignored instead of throwing an error; validation always succeeds for incorrectly defined keywords","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"If used in browser with strict CSP, evaluate if eval is allowed or choose another validator.","message":"Dynamic code generation (eval) used for performance; may be blocked in some environments (e.g., CSP-restricted browsers)","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'-06':85 '/07/2019-09':86 '0.6.6':50 '2019':57 '4':29 'activ':92 'altern':68 'benchmark':63 'built':13 'cadenc':54 'code':18 'current':46 'custom':34 'default':39 'differenti':59 'draft':28,83,84 'dynam':17 'error':37 'extern':32 'faster':66 'format':35 'gather':41 'generat':19 'greedi':43 'howev':77 'javascript':94 'jsck':73 'jsen':1,5 'json':2,6,10,26,81,95 'json-schema':25 'lack':79 'last':55 'like':69 'low':52 'maintain':93 'messag':38 'modern':80 'optim':22 'other':76 'perform':62 'releas':53 'remot':30 'schema':3,11,27,33,72,82,96 'sentinel':7 'show':64 'speed':15,98 'stabl':47 'support':24 'themi':74 'type':88 'typescript':87 'updat':56 'use':16 'v8':21 'valid':4,12,44,97 'valu':40 'version':48 'z':71 'z-schema':70","created_at":"2026-06-07T16:55:38.332311+00:00","updated_at":"2026-06-07T16:55:38.332311+00:00","problems":[{"fix":"Replace 'new jsen(schema)' with 'jsen(schema)'.","cause":"Using 'new jsen()' thinking it's a constructor.","error":"TypeError: jsen is not a function"},{"fix":"Ensure the schema argument is a valid JSON Schema object, e.g., { type: 'string' }.","cause":"Passing a non-object (e.g., string) to jsen.","error":"Error: schema is not a valid schema object"},{"fix":"Validate your schema against JSON Schema metaschema or check keyword definitions.","cause":"Schema has incorrectly defined keywords (e.g., 'properties' as array instead of object).","error":"Validation always returns true"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/bugventure/jsen","github":"https://github.com/bugventure/jsen","docs":null,"changelog":null,"pypi":null,"npm":"jsen","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}