{"id":47550,"library":"farrow-schema","title":"farrow-schema","description":"A powerful and extensible schema builder for TypeScript, part of the Farrow web framework ecosystem. Current stable version is 2.3.3. It provides type-safe runtime validation with a composable schema API, allowing developers to define and validate data structures with full TypeScript inference. Key differentiators include deep type inference from schemas, support for complex nested schemas, and integration with Farrow's HTTP pipeline for end-to-end type safety. Release cadence is irregular, tied to Farrow framework updates. Compared to Zod or io-ts, farrow-schema is designed specifically for Farrow's module-oriented architecture.","status":"active","version":"2.3.3","language":"javascript","source_language":"en","source_url":"https://github.com/farrow-js/farrow","tags":["javascript","Web Framework","TypeScript","Functional Programming","typescript"],"install":[{"cmd":"npm install farrow-schema","lang":"bash","label":"npm"},{"cmd":"yarn add farrow-schema","lang":"bash","label":"yarn"},{"cmd":"pnpm add farrow-schema","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for type inference; schemas rely on TypeScript >=4.3","package":"typescript","optional":true}],"imports":[{"note":"Schema is a named export, not default. Common mistake.","wrong":"import Schema from 'farrow-schema'","symbol":"Schema","correct":"import { Schema } from 'farrow-schema'"},{"note":"CJS require is supported but ESM is recommended.","wrong":"const { Type } = require('farrow-schema')","symbol":"Type","correct":"import { Type } from 'farrow-schema'"},{"note":"validate is a helper function to check data against a schema.","symbol":"validate","correct":"import { validate } from 'farrow-schema'"}],"quickstart":{"code":"import { Schema, Type, validate } from 'farrow-schema';\n\nconst UserSchema = Schema.object({\n  id: Schema.number(),\n  name: Schema.string(),\n  email: Schema.string().pattern(/^[^@]+@[^@]+$/),\n  age: Schema.number().optional()\n});\n\ntype User = Type<typeof UserSchema>;\n\nconst userData = {\n  id: 1,\n  name: 'Alice',\n  email: 'alice@example.com'\n};\n\nconst result = validate(UserSchema, userData);\nif (result.ok) {\n  const user: User = result.value;\n  console.log('Valid user:', user);\n} else {\n  console.error('Validation errors:', result.errors);\n}","lang":"typescript","description":"Schema definition and validation using farrow-schema with TypeScript type inference."},"warnings":[{"fix":"Update to use Schema.object() wrapper: Schema.object({ field: ... }) instead of plain object.","message":"In v2.0, Schema.object() changed from accepting a plain object to requiring Schema.object({...}).","severity":"breaking","affected_versions":">=1.x <2.0"},{"fix":"Upgrade TypeScript to >=4.3 or use explicit type annotations.","message":"Type inference only works with TypeScript >=4.3; earlier versions may not infer correctly.","severity":"gotcha","affected_versions":">=2.0"},{"fix":"Use import { Schema } from 'farrow-schema'.","message":"Schema is a named export, not default; many users mistakenly try default import.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Replace any with unknown in schema definitions.","message":"Schema.any() is deprecated in v2.0; use Schema.unknown() instead.","severity":"deprecated","affected_versions":">=2.0"},{"fix":"Check for ok property instead of success, and use value instead of data.","message":"In v2.0, validate() returns { ok, value } instead of { success, data }.","severity":"breaking","affected_versions":">=1.x <2.0"}],"env_vars":null,"search_vec":"'2.3.3':23 'allow':36 'api':35 'architectur':103 'builder':9 'cadenc':76 'compar':84 'complex':58 'compos':33 'current':19 'data':42 'deep':51 'defin':39 'design':95 'develop':37 'differenti':49 'ecosystem':18 'end':70,72 'end-to-end':69 'extens':7 'farrow':2,15,64,81,92,98 'farrow-schema':1,91 'framework':17,82,106 'full':45 'function':108 'http':66 'includ':50 'infer':47,53 'integr':62 'io':89 'io-t':88 'irregular':78 'javascript':104 'key':48 'modul':101 'module-ori':100 'nest':59 'orient':102 'part':12 'pipelin':67 'power':5 'program':109 'provid':25 'releas':75 'runtim':29 'safe':28 'safeti':74 'schema':3,8,34,55,60,93 'specif':96 'stabl':20 'structur':43 'support':56 'tie':79 'ts':90 'type':27,52,73 'type-saf':26 'typescript':11,46,107,110 'updat':83 'valid':30,41 'version':21 'web':16,105 'zod':86","created_at":"2026-06-07T16:52:05.197044+00:00","updated_at":"2026-06-07T16:52:05.197044+00:00","problems":[{"fix":"Change import to: import { Schema } from 'farrow-schema'","cause":"Default import used instead of named import.","error":"TypeError: (0 , farrow_schema_1.Schema) is not a function"},{"fix":"Upgrade TypeScript or wrap object definition with Schema.object().","cause":"Incompatible TypeScript version (<4.3) or missing schema wrapper.","error":"TS2345: Type '{}' is not assignable to type '...'"},{"fix":"Check for ok and value; upgrade to v2.x.","cause":"Using old validate() return shape from v1.x.","error":"Property 'ok' does not exist on type '{ success: boolean; data: any; errors: any[]; }'"},{"fix":"Replace with Schema.unknown().","cause":"Using deprecated Schema.any() in v2.x.","error":"Error: Unknown schema type: any"}],"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://www.farrowjs.com/","github":"https://github.com/farrow-js/farrow","docs":null,"changelog":null,"pypi":null,"npm":"farrow-schema","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"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}}