Start
Node 20.16 or later.
sh
npx barcode-grader label.pdflabel.pdf: 3 codes on 1 page
UPC-A 036000291452
Check digit right (2)
Size 70%, X 0.231 mm (GS1: 80–200% for retail tills)
Bar height 8.0 mm (needs 16.0 mm at this size)
…
Verdict Will likely fail
x Below GS1's 80–200% for retail tills. Make it at least 80%.Each code gets one of three verdicts.
| verdict | meaning | exit code |
|---|---|---|
| Looks right | nothing found | 0 |
| Check this | worth a look; may be fine for your case | 1 by default (--fail-on fail ignores it) |
| Will likely fail | breaks a GS1 rule, or a scanner is unlikely to read it | 1 |
No code in a file, or a file that can't be read, exits 2.
Pictures need a print size
A PDF or SVG knows how big it prints. A PNG or JPEG only does if it carries a resolution. Without one, everything except size is still checked; give the size to measure it:
sh
npx barcode-grader artwork.png --width 50 # printed width in mm
npx barcode-grader artwork.png --dpi 300Next
- Command line: every option
- Reports: JSON, SARIF, HTML, Markdown, JUnit
- GitHub Action