Socket
Socket
Sign inDemoInstall

@types/har-format

Package Overview
Dependencies
0
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/har-format

TypeScript definitions for HAR


Version published
Maintainers
1
Install size
30.5 kB
Created

Package description

What is @types/har-format?

@types/har-format provides TypeScript type definitions for the HTTP Archive (HAR) format. This package allows developers to work with HAR files in a type-safe manner, ensuring that the structure and data types of HAR files are correctly handled in TypeScript projects.

What are @types/har-format's main functionalities?

Define HAR Log

This feature allows you to define a HAR log object with the necessary properties such as version, creator, and entries. The type definitions ensure that the structure adheres to the HAR specification.

const harLog: harFormat.Log = {
  version: '1.2',
  creator: {
    name: 'Example Browser',
    version: '1.0'
  },
  entries: []
};

Define HAR Entry

This feature allows you to define a HAR entry object, which includes details about an HTTP request and response. The type definitions ensure that all required fields are present and correctly typed.

const harEntry: harFormat.Entry = {
  startedDateTime: new Date().toISOString(),
  time: 100,
  request: {
    method: 'GET',
    url: 'https://example.com',
    httpVersion: 'HTTP/1.1',
    headers: [],
    queryString: [],
    cookies: [],
    headersSize: -1,
    bodySize: -1
  },
  response: {
    status: 200,
    statusText: 'OK',
    httpVersion: 'HTTP/1.1',
    headers: [],
    cookies: [],
    content: {
      size: 0,
      mimeType: 'text/html'
    },
    redirectURL: '',
    headersSize: -1,
    bodySize: -1
  },
  cache: {},
  timings: {
    send: 0,
    wait: 50,
    receive: 50
  }
};

Define HAR Creator

This feature allows you to define the creator of the HAR file, including the name and version of the tool or browser that generated the HAR file. The type definitions ensure that the creator object adheres to the HAR specification.

const harCreator: harFormat.Creator = {
  name: 'Example Browser',
  version: '1.0'
};

Other packages similar to @types/har-format

Readme

Source

Installation

npm install --save @types/har-format

Summary

This package contains type definitions for HAR (https://w3c.github.io/web-performance/specs/HAR/Overview.html).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/har-format.

Additional Details

  • Last updated: Tue, 06 Jul 2021 20:33:13 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Michael Mrowetz, and Marcell Toth.

FAQs

Last updated on 06 Jul 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc