DEV Community

Dr. Reza Madahzadeh
Dr. Reza Madahzadeh

Posted on

I built a zero-dependency CLI that crawls your site and lints its JSON-LD

Structured data breaks silently: the page renders fine while your Product schema has "$19.99" as a price, your LocalBusiness lost its address in a redesign, and your breadcrumbs go 1, 3. Google's Rich Results Test checks one URL at a time — I wanted the whole site, in CI.

schema-audit is a single-file Node.js 20+ CLI with zero npm dependencies:

node schema-audit.mjs https://example.com/
node schema-audit.mjs --sitemap https://example.com/sitemap.xml
npm run demo   # offline demo with seeded issues
Enter fullscreen mode Exit fullscreen mode

It extracts every ld+json block (including @graph and nested entities) and runs 9 checks:

  • JSON validity, @context / @type presence
  • required and recommended properties per type — Article, Product (offers/price/priceCurrency logic), LocalBusiness, FAQPage (question/answer completeness), BreadcrumbList (position order), Event, JobPosting, Recipe and more
  • value sanity: ISO dates, numeric prices, absolute URLs
  • duplicate entities and pages with no structured data at all

Output is a human report with fix hints, or --json, with exit codes designed for CI — run it weekly and fail the build when your markup regresses.

Repo: github.com/madahzadeh/schema-audit (MIT). It deliberately audits JSON-LD only (no Microdata/RDFa) and doesn't execute JavaScript. This is the third tool in my open-source technical-SEO toolkit, next to hreflang-audit and llms-txt-kit — feedback on what to add next is welcome.

Top comments (0)