@har-analyzer/components 0.0.4 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,17 +12,17 @@ yarn add @har-analyzer/components
12
12
  pnpm add @har-analyzer/components
13
13
  ```
14
14
 
15
- ## Components
15
+ ## Components & Hooks
16
16
 
17
- Below are the available components and their usage examples:
17
+ Below are the available exports and their usage examples:
18
18
 
19
- ### HarAnalyzer
19
+ ### HARAnalyzer ([Demo](https://theallanjoshua.github.io/har-analyzer/))
20
20
 
21
21
  ```jsx
22
- import HarAnalyzer from '@har-analyzer/components/har-analyzer';
22
+ import HARAnalyzer from '@har-analyzer/components/har-analyzer';
23
23
 
24
24
  function App() {
25
- return <HarAnalyzer appName="HAR Analyzer" />;
25
+ return <HARAnalyzer appName="HAR Analyzer" />;
26
26
  }
27
27
  ```
28
28
 
@@ -31,21 +31,20 @@ function App() {
31
31
  | Name | Type | Required | Description |
32
32
  |-----------|-----------------|----------|--------------------------------------|
33
33
  | logo | React.ReactNode | No | A logo to display in the header. |
34
- | appName | string | Yes | The name of the application. |
34
+ | appName | string | No | The name of the application. |
35
35
 
36
36
  ---
37
37
 
38
- ### HAREntriesViewer
38
+ ### HARContentViewer
39
39
 
40
40
  ```jsx
41
- import HAREntriesViewer from '@har-analyzer/components/har-entries-viewer';
41
+ import HARContentViewer from '@har-analyzer/components/har-content-viewer';
42
42
 
43
43
  function App() {
44
44
  return (
45
- <HAREntriesViewer
45
+ <HARContentViewer
46
46
  harFileName="example.har"
47
47
  harContent={yourHarContent}
48
- onChange={(selectedEntry) => console.log(selectedEntry)}
49
48
  />
50
49
  );
51
50
  }
@@ -57,7 +56,6 @@ function App() {
57
56
  |---------------|-------------------------------|----------|--------------------------------------------------|
58
57
  | harFileName | string | No | The name of the HAR file being viewed. |
59
58
  | harContent | HarContent | No | The HAR file content object. |
60
- | onChange | (entry: HAREntry) => void | Yes | Callback when a HAR entry is selected. |
61
59
 
62
60
  ---
63
61
 
@@ -87,7 +85,7 @@ import HARFileUploader from '@har-analyzer/components/har-file-uploader';
87
85
  function App() {
88
86
  return (
89
87
  <HARFileUploader
90
- onChange={(harContent, fileName) => console.log(harContent, fileName)}
88
+ onChange={({ harContent, harFileName }) => console.log(harContent, harFileName)}
91
89
  />
92
90
  );
93
91
  }
@@ -95,9 +93,38 @@ function App() {
95
93
 
96
94
  **Props:**
97
95
 
98
- | Name | Type | Required | Description |
99
- |-----------|-------------------------------------------|----------|--------------------------------------------------|
100
- | onChange | (harContent: HarContent, fileName?: string) => void | Yes | Callback when a HAR file is uploaded. |
96
+ | Name | Type | Required | Description |
97
+ |-----------|--------------------------------------------------------------------|----------|--------------------------------------------------|
98
+ | onChange | `(args: { harContent: HARContent; harFileName?: string }) => void` | Yes | Callback when a HAR file is uploaded. |
99
+
100
+ ---
101
+
102
+ ### useHAREntriesFilters
103
+
104
+ A custom React hook for filtering and searching HAR network entries.
105
+
106
+ ```jsx
107
+ import { useHAREntriesFilters } from '@har-analyzer/components';
108
+
109
+ function App() {
110
+ const { filteredEntries, HAREntriesFilters } = useHAREntriesFilters(entries);
111
+ // ...
112
+ }
113
+ ```
114
+
115
+ ---
116
+
117
+ ### HAR Utilities
118
+
119
+ Various types and utilities for working with HTTP Archive (.har) files are directly exported.
120
+
121
+ ```typescript
122
+ import {
123
+ getHARContentFromFile,
124
+ type HARContent,
125
+ type HAREntry
126
+ } from '@har-analyzer/components';
127
+ ```
101
128
 
102
129
  ---
103
130
 
@@ -112,4 +139,4 @@ Contributions are welcome! Please open issues or pull requests on [GitHub](https
112
139
 
113
140
  ## License
114
141
 
115
- MIT
142
+ [MIT](https://github.com/theallanjoshua/har-analyzer/blob/main/LICENSE)