{"id":49225,"library":"revalidator","title":"revalidator","description":"A cross-browser / Node.js validator with JSON Schema compatibility (draft-zyp-json-schema-04). Current stable version is 0.3.1, last released in 2015, no longer actively maintained. It provides a simple `validate(obj, schema)` function that returns `valid` boolean and `errors` array. Key differentiator is lightweight footprint and support for both Node.js and browser environments, but lacks modern JSON Schema features and complete format validation.","status":"deprecated","version":"0.3.1","language":"javascript","source_language":"en","source_url":"http://github.com/flatiron/revalidator","tags":["javascript"],"install":[{"cmd":"npm install revalidator","lang":"bash","label":"npm"},{"cmd":"yarn add revalidator","lang":"bash","label":"yarn"},{"cmd":"pnpm add revalidator","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default export only; named import will be undefined.","wrong":"import { revalidator } from 'revalidator'","symbol":"revalidator","correct":"import revalidator from 'revalidator'"},{"note":"CommonJS style: direct require gets the default export.","wrong":"const { revalidator } = require('revalidator')","symbol":"revalidator","correct":"const revalidator = require('revalidator')"},{"note":"validate is a method on the default export, not a named export. Must destructure after importing.","wrong":"import { validate } from 'revalidator'","symbol":"validate","correct":"const { validate } = revalidator"}],"quickstart":{"code":"import revalidator from 'revalidator';\n\nconst schema = {\n  properties: {\n    name: { type: 'string', required: true, minLength: 2 },\n    age: { type: 'integer', minimum: 0 },\n    email: { type: 'string', pattern: '^[^@]+@[^@]+\\.[^@]+$' }\n  }\n};\n\nconst obj = { name: 'Alice', age: 30, email: 'alice@example.com' };\nconst result = revalidator.validate(obj, schema);\n\nconsole.log('Valid:', result.valid);\nif (!result.valid) {\n  console.log('Errors:', result.errors);\n}","lang":"javascript","description":"Shows basic usage of revalidator.validate() with a JSON Schema and an object, including optional error handling."},"warnings":[{"fix":"Consider migrating to a more modern validator like ajv or joi.","message":"The package is no longer maintained and may not work with newer Node.js versions.","severity":"deprecated","affected_versions":">=0.3.1"},{"fix":"Always pass a fresh options object if reusing the same schema with different options.","message":"The validate method mutates the options object passed to it?","severity":"gotcha","affected_versions":">=0.3.0"},{"fix":"Set additionalProperties: false in options to disallow unknown properties.","message":"The 'additionalProperties' option defaults to true, meaning extra properties in the object are allowed unless explicitly set to false.","severity":"gotcha","affected_versions":">=0.3.0"},{"fix":"Use single type definitions for clarity.","message":"The 'type' property supports arrays (e.g., ['boolean', 'string']) but only validates against the first matching type?","severity":"gotcha","affected_versions":">=0.3.0"},{"fix":"Provide custom format validators or use a validator with built-in format support.","message":"Format validation is limited; for example, 'email', 'date', 'uri' are not validated unless registered via formatExtensions.","severity":"gotcha","affected_versions":">=0.3.0"}],"env_vars":null,"search_vec":"'0.3.1':22 '04':17 '2015':26 'activ':29 'array':45 'boolean':42 'browser':5,57 'compat':11 'complet':66 'cross':4 'cross-brows':3 'current':18 'differenti':47 'draft':13 'draft-zyp-json-schema':12 'environ':58 'error':44 'featur':64 'footprint':50 'format':67 'function':38 'javascript':69 'json':9,15,62 'key':46 'lack':60 'last':23 'lightweight':49 'longer':28 'maintain':30 'modern':61 'node.js':6,55 'obj':36 'provid':32 'releas':24 'return':40 'revalid':1 'schema':10,16,37,63 'simpl':34 'stabl':19 'support':52 'valid':7,35,41,68 'version':20 'zyp':14","created_at":"2026-06-07T17:00:41.797899+00:00","updated_at":"2026-06-07T17:00:41.797899+00:00","problems":[{"fix":"Use: import revalidator from 'revalidator'; then revalidator.validate(...)","cause":"Using named import instead of default import.","error":"TypeError: revalidator.validate is not a function"},{"fix":"Run: npm install revalidator","cause":"Package not installed.","error":"Cannot find module 'revalidator'"},{"fix":"Use a validator that supports recursive additionalProperties checks.","cause":"additionalProperties option only works at the root level, not nested schemas.","error":"Validation returns valid: true for extra properties when additionalProperties is false?"}],"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/flatiron/revalidator","github":"http://github.com/flatiron/revalidator","docs":null,"changelog":null,"pypi":null,"npm":"revalidator","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}}