You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

har-schema

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

har-schema

JSON Schema for HTTP Archive (HAR)


Version published
Maintainers
1
Created

Package description

What is har-schema?

The har-schema npm package provides JSON schemas for HTTP Archive (HAR) format. HAR is a common format used for logging web browser interactions with websites. The schemas provided by har-schema can be used to validate HAR files to ensure they conform to the expected structure.

What are har-schema's main functionalities?

Validate HAR Log

This feature allows you to validate a HAR log against the HAR schema. The code sample uses the Ajv library to compile the HAR log schema and validate a HAR log data object.

const Ajv = require('ajv');
const harSchema = require('har-schema');
const ajv = new Ajv();
const validate = ajv.compile(harSchema.log);
const data = { /* HAR log data */ };
const valid = validate(data);
if (!valid) console.log(validate.errors);

Validate HAR Entries

This feature allows you to validate individual HAR entries against the HAR schema. The code sample uses the Ajv library to compile the HAR entry schema and validate a HAR entry data object.

const Ajv = require('ajv');
const harSchema = require('har-schema');
const ajv = new Ajv();
const validate = ajv.compile(harSchema.entry);
const data = { /* HAR entry data */ };
const valid = validate(data);
if (!valid) console.log(validate.errors);

Other packages similar to har-schema

Readme

Source

HAR Schema version License

JSON Schema for HTTP Archive (HAR).

Build Status Downloads Code Climate Coverage Status Dependency Status Dependencies

Install

npm install --only=production --save har-schema

Usage

Compatible with any JSON Schema validation tool.


:copyright: ahmadnassri.com  ·  License: ISC  ·  Github: @ahmadnassri  ·  Twitter: @ahmadnassri

Keywords

FAQs

Package last updated on 18 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc