validator.js
AGENTS.md24k starsChanged 2 years agoMITView on GitHub
This file provides guidance to AI coding agents working with this repository.
- Installs packages
We split this AGENTS.md into the rules it gives an agent
24 rules. About 0 are common, 16 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈16
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 19
Keep changes focused on the reported behavior.
- Very specific: line 21
Follow the style of recent commit and pull-request titles.
- Distinctive: line 25
Use npm for the official build and test path.
- Very specific: line 27
Prefer the latest Node.js LTS release for local development.
- Very specific: line 28
Run npm run build to generate the Node, ES module, and browser distributions.
- Very specific: line 29
Do not infer a source change from generated output alone.
- Distinctive: line 38
When changing a shared helper, identify and test its public callers.
- Distinctive: line 39
When changing behavior represented in multiple distributions, verify the source implementation and the relevant generated form rather than …
- Distinctive: line 40
If a command fails during setup, distinguish dependency, Node-version, filesystem, and tooling failures from product-code failures before …
- Distinctive: line 45
Prefer the smallest root-cause fix over special-casing a reported input.
- Distinctive: line 46
Keep static locale and format data changes separate from algorithm changes when practical.
- Very specific: line 47
Do not update generated distributions manually.
- Distinctive: line 48
Do not commit, push, publish a package or advisory, open an issue or pull request, or disclose private security material unless explicitly …
- Distinctive: line 52
Update README.md when a public API, option, return contract, or documented limitation changes.
- Very specific: line 53
Read SECURITY.md for the supported-version and vulnerability-reporting policy.
- Very specific: line 54
Read THREAT_MODEL.md before triaging a suspected vulnerability.
- Distinctive: line 55
Do not place private advisories, unpublished findings, reporter information, or private bug-hunt results in public documentation.
- Distinctive: line 59
Before describing a finding as novel, check open and closed issues, pull requests, published advisories, available approved private …
- Distinctive: line 60
Prefer rejecting speculative candidates over presenting unsupported security conclusions.
- Distinctive: line 64
Start from a documented or reasonably supported public API invocation.
- Distinctive: line 66
Add a focused regression test that expresses the expected correct behavior rather than an incidental implementation detail.
- Distinctive: line 67
Run the test against the unchanged implementation and confirm that it fails for the stated reason.
- Very specific: line 68
After a fix, confirm that the focused test passes and run npm test to check the generated builds, lint, and existing test suite.
- Distinctive: line 69
Keep reproductions safe, local, bounded, self-contained, and readable.
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
This file provides guidance to AI coding agents working with this repository.
Project map
- validator.js is a single-package npm project for string validation and sanitization.
src/index.jsdefines the public exports, andsrc/libcontains validators, sanitizers, normalizers, converters, static format data, and shared utilities.test/validators.test.jscontains most API tests; additional test files cover browser builds and individual utilities.README.mdis the primary public API reference. Update it when documented API behavior or options change.build-browser.jscreates the browser bundle. Babel creates the Node and ES module distributions.index.js,lib/,es/,validator.js, andvalidator.min.jsare generated. Do not edit or commit them manually.- The published package contains only the generated distributions,
README.md,LICENSE, and package metadata listed in thefilesfield ofpackage.json. - validator.js has no runtime dependencies. The packages in
devDependenciesare used only to build, lint, and test the project.
Branching and pull requests
- Normal changes target
master. - Keep changes focused on the reported behavior. Avoid unrelated API, formatting, generated-file, or data-table changes.
- Bug fixes should include a focused regression test that fails before the fix and passes afterward.
- Follow the style of recent commit and pull-request titles; the repository does not define a separate title convention in
CONTRIBUTING.md.
Install and build
- Use npm for the official build and test path.
- Install development dependencies with
npm install --legacy-peer-deps, as documented inCONTRIBUTING.mdand used by CI. - Prefer the latest Node.js LTS release for local development. When adding syntax or runtime APIs, follow the compatibility range declared in
package.jsonand verify compatibility with the Node.js versions supported by CI. - Run
npm run buildto generate the Node, ES module, and browser distributions. - Do not infer a source change from generated output alone; inspect the corresponding file under
src/.
Test
npm testis the broad local check. Itspretestlifecycle builds every distribution and runs ESLint before the Mocha suite.npm run lintcheckssrc/andtest/.npm run buildbuilds all published forms without running the tests.- For a focused Mocha run, use
npm test -- --grep '<test name>'; retain the broadnpm testrun before considering a code change complete. - Tests use Mocha, Babel, and nyc. Coverage output under
coverage/and.nyc_output/is generated and should not be committed. - When changing a shared helper, identify and test its public callers. A helper-level test alone does not establish public API behavior.
- When changing behavior represented in multiple distributions, verify the source implementation and the relevant generated form rather than editing generated files.
- If a command fails during setup, distinguish dependency, Node-version, filesystem, and tooling failures from product-code failures before changing source.
Change discipline
- Preserve documented behavior and compatibility outside the stated scope of a change.
- Prefer the smallest root-cause fix over special-casing a reported input.
- Keep static locale and format data changes separate from algorithm changes when practical.
- Do not update generated distributions manually; building and publishing generate them from
src/. - Do not commit, push, publish a package or advisory, open an issue or pull request, or disclose private security material unless explicitly authorized.
Documentation and threat model
- Update
README.mdwhen a public API, option, return contract, or documented limitation changes. - Read
SECURITY.mdfor the supported-version and vulnerability-reporting policy. - Read
THREAT_MODEL.mdbefore triaging a suspected vulnerability. - Do not place private advisories, unpublished findings, reporter information, or private bug-hunt results in public documentation.
Security analysis
- Before describing a finding as novel, check open and closed issues, pull requests, published advisories, available approved private advisory material, tests, documentation, changelog entries, and relevant source history.
- Prefer rejecting speculative candidates over presenting unsupported security conclusions.
Security reproduction standards
- Start from a documented or reasonably supported public API invocation. An internal-helper test alone does not demonstrate public behavior unless that helper is itself public.
- State the exact arguments, options, environment, expected documented behavior, observed behavior, independent security effect, and relevant preconditions.
- Add a focused regression test that expresses the expected correct behavior rather than an incidental implementation detail.
- Run the test against the unchanged implementation and confirm that it fails for the stated reason. If the behavior does not reproduce, stop and report the evidence instead of modifying source.
- After a fix, confirm that the focused test passes and run
npm testto check the generated builds, lint, and existing test suite. - Keep reproductions safe, local, bounded, self-contained, and readable. Do not contact external targets or run unbounded denial-of-service payloads.
- Report the root cause, files changed, before-and-after results, compatibility effects, assumptions, and remaining limitations.
Trending
Quiet since August.about the whole repository
Who's talking about validatorjs/validator.js
- typestack/class-validator“fix: Medium Vulnerability in validator@13.15.15 (CVE-2025-56200)”GitHub · Oct 16, 2025 · 30 reactions
- typestack/class-validator“build: update validator to 13.15.20”GitHub · Oct 26, 2025 · 16 reactions
- Azure/azure-storage-node“Bump validator from 13.6.0 to 13.7.0”GitHub · Nov 3, 2021 · 9 reactions
- Stack Overflow“Safe regex patterns from ReDos attack”Stack Overflow · Jul 28, 2020 · 9 votes
- DefinitelyTyped/DefinitelyTyped“Remove named exports from validator index file”GitHub · Nov 19, 2019 · 9 reactions
The biggest 5 of 67 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 67
Talked about on GitHub, Stack Overflow, the web and Hacker News (67 times).
On GitHub · 50
- Oct 16, 2025fix: Medium Vulnerability in validator@13.15.15 (CVE-2025-56200) — typestack/class-validator30 reactions · 9 comments
- Oct 26, 2025build: update validator to 13.15.20 — typestack/class-validator16 reactions · 12 comments
- Nov 3, 2021Bump validator from 13.6.0 to 13.7.0 — Azure/azure-storage-node9 reactions · 1 comment
- Nov 19, 2019Remove named exports from validator index file — DefinitelyTyped/DefinitelyTyped9 reactions · 19 comments
- Aug 30, 2025fix: IsBase64 validaton leads to "call stack size exceeded" for large strings (update validator package required) — typestack/class-validator5 reactions
45 more on GitHub
- Oct 27, 2021Next 12 - ESM Support - SyntaxError: Cannot use import statement outside a module — vercel/next.js4 reactions · 8 comments
- Dec 9, 2020IsIn validation is not allowed for numbers — sequelize/sequelize-typescript3 reactions
- May 19, 2026Bump validator from 13.12.0 to 13.15.35 — Dustin4444/website-32 reactions · 3 comments
- May 6, 2026Bump the npm_and_yarn group across 1 directory with 11 updates — quazfenton/battleArena2 reactions · 3 comments
- May 5, 2026Bump the npm_and_yarn group across 7 directories with 29 updates — Asylum4You/gitpod2 reactions
- May 3, 2026Bump the npm_and_yarn group across 7 directories with 33 updates — Asylum4You/gitpod2 reactions
- May 2, 2026Bump the npm_and_yarn group across 6 directories with 33 updates — Asylum4You/gitpod2 reactions · 1 comment
- Apr 6, 2026deps(deps): bump the security-updates group with 17 updates — koushik369mondal/WanderLust2 reactions · 5 comments
- Apr 1, 2026Bump validator from 13.15.15 to 13.15.22 — cicero-im/Elysia-Light2 reactions · 2 comments
- Apr 1, 2026Bump validator from 13.12.0 to 13.15.26 in /backend — cicero-im/AI-Gov-Content-Curator2 reactions · 1 comment
- Mar 14, 2026Bump the npm_and_yarn group across 5 directories with 37 updates — Asylum4You/gitpod2 reactions · 1 comment
- Feb 22, 2026Bump the npm_and_yarn group across 4 directories with 18 updates — cicero-im/plate2 reactions · 4 comments
- Feb 20, 2026Bump the npm_and_yarn group across 5 directories with 13 updates — RemyLoveLogicAI/bytebot2 reactions · 13 comments
- Jan 30, 2026Bump the npm_and_yarn group across 2 directories with 18 updates — GlacierEQ/MemicOS2 reactions · 4 comments
- Jan 19, 2026chore(deps): bump the npm_and_yarn group across 1 directory with 9 updates — patrik-fredon/semaphore2 reactions
- Jan 19, 2026chore(deps): bump the npm_and_yarn group across 3 directories with 13 updates — patrik-fredon/kratos2 reactions · 1 comment
- Dec 1, 2025fix: isUUID validation fails for UUID like strings — typestack/class-validator2 reactions · 1 comment
- Jan 20, 2021fix(types): allow any values in `isIn` validator — sequelize/sequelize2 reactions · 2 comments
- Oct 14, 2020fix: IsPostalCode — typestack/class-validator2 reactions · 4 comments
- Aug 10, 2026chore(deps): bump express-validator from 6.15.0 to 7.3.2 — equals9/vitalcv-monorepo1 reaction · 1 comment
- Apr 10, 2026build(deps): bump the npm_and_yarn group across 1 directory with 7 updates — EndofTimeWorks/slack-end1 reaction · 1 comment
- Apr 9, 2026chore(deps): bump validator from 13.11.0 to 13.15.35 — Ahmedhajjajofficial/metrics1 reaction
- Apr 3, 2026Bump validator from 13.15.0 to 13.15.35 — SallaApp/express-starter-kit1 reaction · 2 comments
- Mar 19, 2026Bump the npm_and_yarn group across 6 directories with 37 updates — Asylum4You/gitpod1 reaction
- Mar 10, 2026Bump the npm_and_yarn group across 1 directory with 5 updates — ethyca/fides1 reaction · 4 comments
- Mar 3, 2026Bump the npm_and_yarn group across 4 directories with 14 updates — jgeofil/nocodb1 reaction · 1 comment
- Mar 2, 2026Bump the npm_and_yarn group across 1 directory with 3 updates — Wbaker7702/github-app-js-sample1 reaction
- Mar 1, 2026Bump the npm_and_yarn group across 4 directories with 15 updates — jgeofil/nocodb1 reaction · 1 comment
- Mar 1, 2026ValidatorJS Error module not found workaround not working. — GeKorm/better-auth-harmony1 reaction · 1 comment
- Feb 25, 2026chore(deps): bump the npm_and_yarn group across 13 directories with 19 updates — Tour-Der-Wang-Dev/medusa1 reaction
- Feb 24, 2026chore(deps): Bump the npm_and_yarn group across 8 directories with 9 updates — cceneag/n8n1 reaction
- Feb 22, 2026chore(deps): bump the npm_and_yarn group across 14 directories with 18 updates — Tour-Der-Wang-Dev/medusa1 reaction
- Feb 20, 2026Bump the npm_and_yarn group across 2 directories with 12 updates — Astevba/yeetcode1 reaction
- Feb 20, 2026chore(deps): Bump the npm_and_yarn group across 2 directories with 9 updates — jgeofil/AutoGPT1 reaction · 2 comments
- Feb 20, 2026Bump the npm_and_yarn group across 2 directories with 20 updates — archive-jgf/neuronpedia1 reaction · 1 comment
- Feb 7, 2026build(deps): bump the npm_and_yarn group across 1 directory with 6 updates — GlacierEQ/WeKnora1 reaction · 2 comments
- Feb 6, 2026Bump validator from 13.12.0 to 13.15.26 — kodustech/kodus-service-analytics1 reaction · 1 comment
- Jan 14, 2026`validator` bump causes regression — typestack/class-validator1 reaction
- Jan 5, 2026Bump validator from 13.11.0 to 13.15.26 — PangeanicAI/EcoDrive-Connector-Frontend1 reaction · 1 comment
- Dec 2, 2025build(deps): bump validator from 13.15.0 to 13.15.23 — mikashboks/template-nodejs1 reaction
- Dec 2, 2025chore(deps): Bump validator from 13.12.0 to 13.15.23 — lettercms/core1 reaction
- Dec 2, 2025build(deps): bump validator and express-validator in /packages/server/browser-automation-api — customeros/customeros1 reaction
- Dec 2, 2025build(deps): bump validator from 13.7.0 to 13.15.23 — powerhome/backstage1 reaction
- Dec 2, 2025[Snyk] Upgrade validator from 13.15.20 to 13.15.23 — xak1234/GitExplorer1 reaction · 2 comments
- Mar 14, 2023Verify that the locale data use the correct characters — faker-js/faker1 reaction · 10 comments
On Stack Overflow · 12
- Jul 28, 2020Safe regex patterns from ReDos attack9 votes · 2 answers
- Sep 12, 2020How to display Sequelize validation error messages in Express API7 votes · 4 answers
- Dec 15, 2021express validator : how to check for "+xyz" using query check?5 votes · 1 answer
- Oct 5, 2020How to validate URLs with express?3 votes
- May 25, 2021express-validator : How to validate "start date" is before "end date"2 votes
7 more on Stack Overflow
- Feb 16, 2021Why is vscode IntelliSense only working after typing .default.?1 vote
- Oct 15, 2019How to call validate.js and use it in feature file (to verify the response)?1 vote · 1 answer
- Jun 12, 2024Check if a date string is in ISO and UTC format0 votes
- Oct 22, 2021Validate array of objects in Node0 votes
- Sep 14, 2021SyntaxError: Cannot use import statement outside a module (from dependency)0 votes
- Aug 28, 2021validator.isAlpha in a mongoose schema0 votes
- Feb 9, 2021sanitation of user input nodeJs - Express0 votes · 1 answer
On the web · 4
- Apr 2, 2026validator@13.15.35 — google.com
- Nov 17, 2025types/validator - A CDN for npm and GitHub — google.com
- Jun 3, 2025org.webjars.npm:github-com-validatorjs-validator-js - Socket.dev — google.com
- Nov 3, 2023Validator JS - Overview (O11) — google.com
On Hacker News · 1
- Feb 23, 2022Validator.js – String Validation3 points
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 28,693 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

