diff options
| author | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2026-02-05 16:03:08 +0000 |
|---|---|---|
| committer | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2026-02-05 16:03:08 +0000 |
| commit | 4775de64eb752b90267114c0c1c95235820521f3 (patch) | |
| tree | a24d73dd2ebe337a45bb6347c7be856bf72afad4 /validators/nodejs/README.md | |
| parent | 6857b2514ac26a0731208e6f7c312cd70b606544 (diff) | |
| download | gitinfo-4775de64eb752b90267114c0c1c95235820521f3.tar gitinfo-4775de64eb752b90267114c0c1c95235820521f3.tar.gz gitinfo-4775de64eb752b90267114c0c1c95235820521f3.tar.bz2 gitinfo-4775de64eb752b90267114c0c1c95235820521f3.tar.xz gitinfo-4775de64eb752b90267114c0c1c95235820521f3.zip | |
add CLI validators in Node.js, PowerShell, and Bash
Move validate.js to validators/nodejs/ and add equivalent
validators for PowerShell and Bash. Each includes a README
with usage instructions and requirements.
Diffstat (limited to 'validators/nodejs/README.md')
| -rw-r--r-- | validators/nodejs/README.md | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/validators/nodejs/README.md b/validators/nodejs/README.md new file mode 100644 index 0000000..4fe9fa6 --- /dev/null +++ b/validators/nodejs/README.md @@ -0,0 +1,37 @@ +# Node.js Validator + +A zero-dependency Node.js CLI tool for validating `.gitinfo` files. + +## Requirements + +- Node.js 14+ + +## Usage + +```bash +# Validate .gitinfo in current directory +node validate.js + +# Validate a specific file +node validate.js path/to/.gitinfo +``` + +## Features + +- Parses JSONC (strips `//` and `/* */` comments) +- Validates against the gitinfo JSON Schema +- Checks types, formats (URI, email), and patterns +- Enforces `additionalProperties: false` +- Returns exit code 0 on success, 1 on failure + +## Example Output + +``` +✓ .gitinfo is valid +``` + +``` +Validation failed for .gitinfo: + - .root: invalid URI "not-a-url" + - root: unknown property "invalid_field" +``` |
