Zero-dependency TypeScript library for validating HAR 1.2 (HTTP Archive) files, designed as a modern replacement for the deprecated har-validator package. Current version 0.1.0, released as an independent migration helper supporting Node >=18. Key differentiators: fully typed with TypeScript, no external dependencies, offers both synchronous (validateHar, assertHar, isHar) and Promise-based (har, request, response, entry) APIs, and provides structured validation results with detailed issues instead of simple boolean flags. Suitable for projects migrating away from har-validator or building new HAR validation pipelines.
npm install har-guardNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates synchronous validation, assertion, and type guard with a sample HAR 1.2 object.
Ensure your project uses ESM (type: module in package.json) and use import syntax.
Access result.valid to check validity, not the result directly.
Migrate from har-validator to har-guard as recommended by the original project.
Use .catch() or try/catch with async/await to handle errors.
Switch your project to ESM (add type: module to package.json) and use import statements.
Use import { validateHar } from 'har-guard' correctly.No dependency data recorded yet.