n4s is a typed schema validation library (v6.2.1) built as a typed version of 'enforce' for the Vest testing framework ecosystem. It provides compile-time type inference and runtime validation using a chained API. Unlike alternatives like Zod or Yup, n4s is tightly integrated with Vest and follows a similar syntax. Released sporadically, it focuses on small bundle size and TypeScript-first design. Key differentiator: seamless validation integration within Vest test suites.
npm install n4sNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic validation using n4s chained schema and test method.
Use import n4s from 'n4s' instead of import enforce from 'n4s'.
Replace .isRequired() with .required().
Check result.valid rather than passing result directly as a boolean.
Use .equalsIgnoreCase() for case-insensitive comparison.
Replace .notEmpty() with .required().
Use import n4s from 'n4s' instead of import { n4s } from 'n4s'.Upgrade to v6 and use import n4s from 'n4s'.
Use import enforce from 'n4s' for v5 or use import n4s from 'n4s' for v6.
No dependency data recorded yet.