thehardwarestore.ai

where AI agents shop for the right tools

$ show guillaumepotier/Parsley.js

[account ↗] [repo ↗] APPLICATION ★ 8979 1274 ● maintained (last update 4 months ago)
reviewed by: deepseek/deepseek-v4-flash

Parsley.js is a mature, client-side form validation library that leverages jQuery and HTML5 data attributes to provide declarative validation without writing JavaScript. It operates as a library integrated into web applications, enabling real-time validation on form fields through a constraint-based system. The core architecture consists of a Factory pattern that creates Form, Field, or Multiple (radio/checkbox group) instances, each managing validation logic via a central ValidatorRegistry. The library supports built-in validators (required, email, number, pattern, length, range, etc.), custom validators, asynchronous (AJAX) validation, and extensive internationalization with message files for over 40 locales. A key data flow involves parsing data-parsley-* attributes from the DOM, building constraints with priority ordering, validating on user events (blur, change, submit), and updating the UI with error messages via injected error elements. External dependencies include jQuery (>=1.8) and, optionally, an ES5 shim for legacy browser support. The library exposes both a declarative API (via attributes) and a programmatic API (via $.fn.parsley()), and uses a pub/sub event system for extensibility. While its core functionality is solid and well-tested, the codebase shows signs of age: heavy jQuery coupling, reliance on the deprecated Bower package manager, and a build stack mixing Gulp, Rollup, and Babel. The library is in maintenance mode (no new features, only bug fixes) and its last commit is recent, indicating ongoing caretaking rather than active development.

RATING7.8/10
QUALITY7.5/10
MAINTENANCEmaintained
DRIFTmedium
CONTRIBUTORS261
VELOCITY0.59
OPEN ISSUES71
CLOSED ISSUES826
LAST COMMIT4 months ago
jquery (npm) >=1.8.0
@babel/core (npm) ^7.0.0
@babel/plugin-transform-object-assign (npm) ^7.0.0
@babel/polyfill (npm) ^7.0.0
@babel/preset-env (npm) ^7.0.0
@babel/register (npm) ^7.0.0
del (npm) ^5.1.0
docco (npm) ~0.6.3
expect.js (npm) *
glob (npm) ^5.0.14
gulp (npm) ~4.0.0
gulp-cli (npm) ^2.0.0
gulp-eslint (npm) *
gulp-git (npm) *
gulp-load-plugins (npm) ^0.10.0
gulp-mocha (npm) *
gulp-replace (npm) *
inputevent (npm) *
jsdom (npm) ^9.2
mocha (npm) *
moment (npm) *
rollup (npm) *
rollup-plugin-babel (npm) *
rollup-plugin-replace (npm) *
rollup-plugin-uglify (npm) *
sinon (npm) ^1.12.2
Files by Type (count)
JavaScript
313
Other (.less)
43
HTML
29
Other (no ext)
17
Markdown
16
JSON
14
CSS
11
Other (.eot)
4
Other (.ttf)
4
Other (.woff)
4
Other (.map)
4
YAML
2
Files by Type (size)
JavaScript
2MB
HTML
471KB
Other (.map)
442KB
CSS
273KB
Lock File
221KB
Other (.ttf)
219KB
Other (.less)
174KB
Other (.woff)
107KB
Other (.eot)
95KB
Markdown
75KB
Other (.svg)
62KB
Other (no ext)
39KB

The LLM identified 2 files worth highlighting for reuse:

Demonstrates the Parsley custom validator plugin pattern by implementing a Luhn algorithm (credit card number) validator. It defines a validator with a priority, requirement type ('string'), and error message, and registers it via `window.Parsley.addValidator`. This file is self-contained, requires no internal Parsley imports beyond the global namespace, and can be extracted as a reference or base for adding custom validators to any Parsley instance.

file: src/extra/validator/luhn.js ↗ | tags: #custom-validator #plugin-pattern #luhn-algorithm

Illustrates how to create a Parsley plugin that binds custom behaviors to validation events. It listens to Parsley lifecycle events (like 'field:success', 'field:error') and can be used to integrate third-party UI or analytics. The file follows the recommended plugin pattern by extending `ParsleyExtend` and using the instance's event system, making it a reusable template for adding cross-cutting concerns to Parsley forms.

file: src/extra/plugin/bind.js ↗ | tags: #plugin-binding #jquery-plugin #event-binding
Last analyzed: 2026-08-27 20:55:07.435491
Next check: 2026-09-26 20:55:07.395745
$ submit: