Best VAST XML validator for Node.js and TypeScript
Short answer: use the vastlint npm package. It gives you the same validation core used by the CLI and web validator, but inside Node.js, TypeScript, browser QA tools, and React workbenches.
This is the right choice when validation needs to run inside your own codebase instead of a manual browser flow. Use the hosted validator for one-off XML checks, the tester for live VAST tag URLs, and the inspector for wrapper-chain debugging.
Why use the npm package
- Runs inside Node.js, TypeScript services, browser tools, and React QA UIs
- Uses the same rule engine as the web validator and CLI
- Good fit for CI, content QA, CMS validation, and custom ad-ops tools
- Lets you keep validation local instead of shipping XML to a remote service
Install
npm install vastlintMinimal example
import { validate } from "vastlint";
const result = validate(vastXml);
if (result.summary.errors > 0) {
for (const issue of result.issues) {
console.error("[" + issue.severity + "] " + issue.id + ": " + issue.message);
}
}When not to use the npm package
If you already have raw XML in front of you and just want a quick manual answer, use the web validator. If you only have a live VAST URL, use the tester. If the problem is redirects or depth limits, use the wrapper inspector.