MCPcopy Index your code
hub / github.com/Lemoncode/fonk

github.com/Lemoncode/fonk @v1.5.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.5.4 ↗ · + Follow
825 symbols 2,161 edges 494 files 82 documented · 10% 1 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Fonk

CI NPM Version bundle-size bundle-size

✅ Zero dependencies

✅ Plain vanilla js

✅ Framework Agnostic

✅ Seamless integration with React Final Form

✅ Seamless integration with Formik

✅ 💥 <4.5k gzipped 💥

Form schema validation library.

let's get fonky

Fonk is a pure javascript, framework agnostic, form validation library.

It allows you to:

  • Define validations that apply to your form in a declarative way.
  • Isolate your form validation business logic from the ui.
  • Unit test your form validation without having to mount the ui.
  • Create reusable validation rules that can be easily unit tested.

validate-field

Live Demo (Fonk + React Final Form)

Fonk can be easily plugged into many libraries / frameworks or just be used in plain vanilla js.

Available integration examples: - Plain vanilla ES6. - React - React Final form. - Formik.

Coming soon integration examples: - Vuejs.

How to get started

Check our Fonk Documentation site.

About Basefactor + Lemoncode

We are an innovating team of Javascript experts, passionate about turning your ideas into robust products.

Basefactor, consultancy by Lemoncode provides consultancy and coaching services.

Lemoncode provides training services.

For the LATAM/Spanish audience we are running an Online Front End Master degree, more info: http://lemoncode.net/master-frontend

Extension points exported contracts — how you extend this code

FieldValidatorArgs (Interface)
(no doc)
src/model/field-validator.model.ts
RequiredArgs (Interface)
(no doc)
src/validators/required.ts
MatchFieldArgs (Interface)
(no doc)
examples/react-final-form/ts/validate-form/src/custom-validators/match-field.validator.ts
MatchFieldArgs (Interface)
(no doc)
examples/vanilla/ts/validate-form/src/custom-validators/match-field.validator.ts
CustomArgs (Interface)
(no doc)
examples/docs/validators/ts/react-final-form/iban-custom-sync-validator/src/custom-validators/iban.validator.ts
FormValidation (Interface)
(no doc)
typings/index.d.ts
FieldValidatorArgs (Interface)
(no doc)
typings/model/field-validator.model.ts
FullFieldValidation (Interface)
(no doc)
src/model/field-validator.model.ts

Core symbols most depended-on inside this repo

createFormValidation
called by 85
src/form-validation.ts
set
called by 81
src/helpers/set.js
createDefaultValidationResult
called by 76
src/model/result.model.ts
createFormValidation
called by 48
examples/docs/messages/ts/react-final-form/i18n-full-example/src/validation/form-validation.ts
fireSingleFieldValidations
called by 23
src/validation-dispatcher/single-field-dispatcher.ts
isPromise
called by 22
src/helpers/helpers.ts
fireSingleRecordValidations
called by 21
src/validation-dispatcher/single-record-dispatcher.ts
parseMessageWithCustomArgs
called by 19
src/validators/validators.helpers.ts

Shape

Function 773
Interface 48
Class 2
Method 2

Languages

TypeScript100%

Modules by API surface

src/helpers/set.js43 symbols
src/helpers/get.js41 symbols
src/helpers/helpers.ts12 symbols
src/model/result.model.ts10 symbols
examples/vanilla/ts/shopping-cart-array-validator/src/index.ts7 symbols
examples/vanilla/ts/multiple-user-creation-array-validator/src/index.ts7 symbols
examples/vanilla/js/shopping-cart-array-validator/src/index.js7 symbols
examples/vanilla/js/multiple-user-creation-array-validator/src/index.js7 symbols
typings/model/result.model.ts6 symbols
src/validators/required.ts6 symbols
examples/vanilla/ts/validate-field-record-and-form/src/index.ts6 symbols
examples/vanilla/js/validate-field-record-and-form/src/index.js6 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add fonk \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact