Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
@types/har-format
Advanced tools
@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.
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'
};
har-validator is a package that provides a set of schemas to validate HAR files. It ensures that the HAR files conform to the HAR specification. Unlike @types/har-format, which provides TypeScript type definitions, har-validator focuses on validation of HAR data.
har-schema provides JSON schemas for the HAR format. It is used to validate HAR files against the official HAR specification. While @types/har-format provides TypeScript type definitions, har-schema provides JSON schemas for validation purposes.
har is a package that provides utilities for working with HAR files, including parsing and stringifying HAR data. It offers more functionality compared to @types/har-format, which is limited to providing type definitions.
npm install --save @types/har-format
This package contains type definitions for HAR (https://w3c.github.io/web-performance/specs/HAR/Overview.html).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/har-format.
These definitions were written by Michael Mrowetz, and Marcell Toth.
FAQs
TypeScript definitions for har-format
The npm package @types/har-format receives a total of 473,708 weekly downloads. As such, @types/har-format popularity was classified as popular.
We found that @types/har-format demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
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.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.