validatorjs/validator.js
61.2
Adequate · 1 October 2026
5.4k
lines of production code
JavaScript
primary language
2
measurements over time
What this system is
This system is a JavaScript validation and sanitization library that provides a comprehensive suite of functions for checking data formats and transforming strings. It supports a wide range of validators for emails, URLs, financial identifiers, and cryptographic hashes, alongside utilities for trimming, escaping, and type checking. The library is structured as ES modules to enable tree-shaking and includes robust tooling for building, linting, and testing across various environments.
Features
Library refactored into individual ES modules with new validation capabilities
The library has been migrated from a single monolithic file to individual ES modules, allowing you to import only the specific validators you need (e.g., \import isEmail from 'validator/lib/isEmail'\) to reduce bundle size. This change introduces several new validators, including \isAbaRouting\, \isBIC\, \isBase32\, \isBase58\, \isBtcAddress\, \isDataURI\, \isEAN\, \isOctal\, \isSemVer\, \isStrongPassword\, \isTime\, \isULID\, and \isUUID\ (with v7 support). Existing validators have also been enhanced: \isBase64\ now supports URL-safe encoding, \isBoolean\ accepts a \loose\ option, \isEmail\ supports host blacklists/whitelists and display names, \isMobilePhone\ has expanded locale coverage, and \isDate\ now supports strict mode and custom formats.
src/lib · high confidence
Removals
Removal of legacy validation and filtering modules
The library has removed the legacy \lib/filter.js\ and \lib/validator.js\ files, along with their exports in \lib/index.js\. This eliminates the old prototype-based \Validator\ and \Filter\ APIs (including methods like \isEmail\, \isUrl\, \isAlpha\, and filter functions like \ifNull\), effectively removing these validation and sanitization capabilities from the public interface.
lib · high confidence
Behavioural changes
Refactored utility functions for improved validation and compatibility
The utility layer in src/lib/util has been restructured to enhance validation robustness and browser compatibility. A new assertString function now strictly enforces string inputs by throwing TypeErrors for null, undefined, or non-string values, replacing previous implicit handling. To support older browsers like Internet Explorer, array and string inclusion checks now use custom implementations (includesArray, includesString) instead of native methods that may lack support. Additionally, new helper utilities have been introduced: typeOf provides accurate type detection for complex objects, toString safely converts inputs to strings, nullUndefinedCheck simplifies null/undefined checks, merge handles object defaults safely, multilineRegex assists in building complex regex patterns, and algorithms.js introduces standard validation algorithms (Luhn, ISO 7064, Verhoeff) for use by other validators. The checkHost utility now supports both string and regular expression matches for host validation.
src/lib/util · high confidence
Test coverage
Added test coverage for multiple validators; Port test suite to Mocha and add coverage for exports and minified build.
Dependencies
Build tooling migrated to Babel 7 and ESLint Airbnb base config
The project's build and linting infrastructure has been updated to use Babel 7 (via \@babel/preset-env\) and ESLint with the \airbnb-base\ configuration. This change introduces new configuration files (\.babelrc\, \.eslintrc.json\) to manage transpilation targets and code style rules, replacing the previous setup. It also updates the \.gitignore\ to exclude generated build artifacts and lockfiles, and configures \nyc\ for code coverage reporting.
(repo-wide) · high confidence
Release of validator library version 13.15.35
This update releases version 13.15.35 of the validation library. The \src/index.js\ file serves as the central entry point, aggregating and exporting a comprehensive suite of validation functions (such as \isEmail\, \isURL\, \isJWT\, \isIBAN\, and \isStrongPassword\) alongside utility methods (like \trim\, \escape\, and \unescape\). For users, this represents the standard distribution of the library's capabilities, ensuring that all available validators and transformation utilities are accessible from the main package import.
src · high confidence
Upgrade to validator v13.15.35 with modern build tooling
The library has been updated from version 0.0.1 to 13.15.35, introducing a modernized build system using Babel 7 and Rollup to support ES modules and optimized browser bundles. This change updates the entry point to \index.js\, adds \sideEffects: false\ for better tree-shaking, and refreshes development dependencies including ESLint, Mocha, and UglifyJS. The package metadata has also been updated to reflect the new repository URL and contributor information.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 61 → 61 (+0.3)
- Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.
Lenses
- Code Health 52 → 52 (+0.0)
- Architecture 100 → 100 (+0.0)
- Maturity 59 → 59 (+0.1)
- Readiness 72 → 73 (+0.5)
- Security 74 → 77 (+2.6)
Resolved (4)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Hotspot: src/lib/isTaxID.js (src/lib/isTaxID.js)
- Off-boarding risk: anonymized user #1
New (2)
- Off-boarding risk: anonymized user #1
- Scanner failed to run — not a clean result
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
validatorjs/validator.js was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 1 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 9ff342479591ca5a43cb30000195bcf55c1bbed9 — the exact code this score is about.
- Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.