npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@har-analyzer/components

v0.0.28

Published

Reusable React components for HAR Analyzer

Readme

@har-analyzer/components

npm version npm bundle size (minified + gzip) build status

Reusable React components and feature modules for HAR Analyzer.

Checkout the demo here

What This Package Includes

  • Ready-made dashboard modules for both web apps and browser extensions.
  • A configurable HAR entries viewer with compare mode.
  • File upload, tabbed HAR entry inspection, and network table components.
  • External state helpers for persisting user preferences outside React state.
  • HAR utilities and types for parsing/filtering/formatting entry data.

Installation

npm install @har-analyzer/components
# or
yarn add @har-analyzer/components
# or
pnpm add @har-analyzer/components

Peer Dependencies

Install peer dependencies in your app:

npm install react react-dom \
  @cloudscape-design/components \
  @cloudscape-design/board-components \
  @cloudscape-design/code-view \
  @cloudscape-design/collection-hooks \
  @cloudscape-design/design-tokens \
  @cloudscape-design/global-styles

Quick Start

Most feature modules rely on:

  • Cloudscape i18n provider.
  • External store provider for persisted preferences.
import { I18nProvider } from '@cloudscape-design/components/i18n';
import enMessages from '@cloudscape-design/components/i18n/messages/all.en';
import type { ExternalStore } from '@har-analyzer/components/external-state';
import { ExternalStoreProvider } from '@har-analyzer/components/external-state';
import HARAnalyzerWebsite from '@har-analyzer/components/har-analyzer-website';

const store: ExternalStore = {
  get: async (key) => localStorage.getItem(key) ?? undefined,
  set: async (key, value) => localStorage.setItem(key, value),
};

export function App() {
  return (
    <I18nProvider locale='en' messages={[enMessages]}>
      <ExternalStoreProvider store={store}>
        <HARAnalyzerWebsite appName='HAR Analyzer' />
      </ExternalStoreProvider>
    </I18nProvider>
  );
}

Public API

Root Exports (@har-analyzer/components)

import {
  HARAnalyzerWebsite,
  HARAnalyzerExtension,
  HAREntriesViewer,
  HAREntriesFilters,
  HAREntriesFiltersProvider,
  useFilteredHAREntries,
  HARFileUploader,
  useFileHAREntries,
  ListHAREntries,
  ViewHAREntry,
  ExternalStoreProvider,
  createExternalState,
  DEFAULT_HAR_ENTRY_ATTRIBUTES_TO_VALUE_MAP,
  getHARContentFromFile,
  getHAREntriesFilteredByContentType,
  getHAREntriesWithErrorResponse,
  getHAREntryAttributesToValuesMap,
  getHAREntryHeadersToValuesMap,
  getHAREntryId,
  getUniqueHeaderNames,
  isErrorResponse,
  HAR_HEADER_TYPES,
} from '@har-analyzer/components';

import type {
  ExternalStore,
  HARAnalyzerExtensionProps,
  HARAnalyzerWebsiteProps,
  HAREntriesViewerProps,
  HARFileUploaderProps,
  ListHAREntriesProps,
  ViewHAREntryProps,
  HAREntry,
  HARContent,
  ContentTypeGroup,
} from '@har-analyzer/components';

Feature Module Exports (@har-analyzer/components/<feature>)

  • external-state
    • ExternalStoreProvider
    • createExternalState
    • type ExternalStore
  • har-analyzer-website
    • default HARAnalyzerWebsite
    • type HARAnalyzerWebsiteProps
  • har-analyzer-extension
    • default HARAnalyzerExtension
    • type HARAnalyzerExtensionProps
  • har-entries-viewer
    • default HAREntriesViewer
    • type HAREntriesViewerProps
  • har-entries-filters
    • HAREntriesFilters
    • HAREntriesFiltersProvider
    • useFilteredHAREntries
  • har-file-uploader
    • HARFileUploader
    • useFileHAREntries
    • type HARFileUploaderProps
  • list-har-entries
    • default ListHAREntries
    • type ListHAREntriesProps
  • view-har-entry
    • default ViewHAREntry
    • type ViewHAREntryProps

Feature Modules

HARAnalyzerWebsite

Drop-in website experience that composes:

  • HAR file upload.
  • Entries dashboard.
  • Theme and content-width preferences via external state.

Props:

| Name | Type | Required | Description | | --- | --- | --- | --- | | logo | ReactNode | No | Header logo element. | | appName | string | No | Application title. Defaults to HAR Analyzer. |


HARAnalyzerExtension

Extension-oriented viewer with built-in action controls.

Includes:

  • Reload action with optional ignore-cache toggle.
  • Clear action.
  • Upload shortcut button.
  • Download current entries as a HAR file.

Props:

| Name | Type | Required | Description | | --- | --- | --- | --- | | pageHAREntries | HAREntry[] | Yes | Entries captured from the active page/session. | | onClear | () => void | Yes | Called when user clicks clear. | | onReload | (ignoreCache: boolean) => void | Yes | Called when user clicks reload. |


HAREntriesViewer

Main dashboard module for multi-panel HAR exploration.

Capabilities:

  • Responsive board layout.
  • Built-in action stripe for compare mode and header selection.
  • Inline filtering integration.
  • Auto sync between selected rows and detail panels.
  • Optional custom actions area via additionalActions.

Props:

| Name | Type | Required | Description | | --- | --- | --- | --- | | harEntries | HAREntry[] | Yes | Entries displayed in table/detail views. | | tableTitle | string | No | Header title for the list panel. | | additionalActions | ReactNode | No | Extra controls rendered on the action stripe. |


HARFileUploader

Uploader for a single .har file.

Validation behavior:

  • Requires exactly one file.
  • Accepts .har extension only.
  • Emits parsed entries and filename on success.

Props:

| Name | Type | Required | Description | | --- | --- | --- | --- | | onUpload | (args: { harEntries: HAREntry[]; harFileName: string }) => void | Yes | Called after parse success. | | onRemove | () => void | Yes | Called when the uploaded file is removed. |


ListHAREntries

Table view for HAR entries.

Highlights:

  • Sortable typed columns (status, time, size, timestamps).
  • Dynamic request/response header columns discovered from entries.
  • Single- or multi-select mode.
  • Persisted table preferences through external state.

Props:

| Name | Type | Required | Description | | --- | --- | --- | --- | | harEntries | HAREntry[] | Yes | Rows to display. | | selectedHAREntries | HAREntry[] | Yes | Controlled selected rows. | | onSelectionChange | (selectedHAREntries: HAREntry[]) => void | Yes | Selection callback. | | enableMultiSelect | boolean | No | Enables multi-selection mode. |


ViewHAREntry

Tabbed detailed inspector for one HAR entry.

Tabs:

  • Request headers.
  • Request payload.
  • Request cookies.
  • Response headers.
  • Response payload.
  • Raw HAR entry JSON.

Props:

| Name | Type | Required | Description | | --- | --- | --- | --- | | harEntry | HAREntry | Yes | Entry to inspect. | | initialSelectedTabId | string | No | Initial active tab id. Defaults to request-headers. | | onSelectedTabIdChange | (tabId: string) => void | No | Active tab change callback. |


External State Utilities

Use createExternalState to build reusable preference hooks/providers backed by the external store.

import { createExternalState } from '@har-analyzer/components';

export const {
  useExternalState: useIsDarkTheme,
  Provider: DarkThemeProvider,
} = createExternalState('my-app.theme.dark', false);

ExternalStore Interface

interface ExternalStore {
  get: (key: string) => Promise<string | undefined>;
  set: (key: string, value: string) => Promise<void>;
}

HAR Utility Exports

Top-level utility exports include:

  • getHARContentFromFile
  • getHAREntriesFilteredByContentType
  • getHAREntriesWithErrorResponse
  • isErrorResponse
  • getUniqueHeaderNames
  • getHAREntryHeadersToValuesMap
  • getHAREntryAttributesToValuesMap
  • getHAREntryId
  • HAR_HEADER_TYPES
  • DEFAULT_HAR_ENTRY_ATTRIBUTES_TO_VALUE_MAP
  • Types: HARContent, HAREntry, ContentTypeGroup

Development

# from repository root
pnpm install

# develop components package
pnpm --filter @har-analyzer/components dev

# validate components package
pnpm --filter @har-analyzer/components validate

Useful scripts in this package:

  • pnpm --filter @har-analyzer/components lint
  • pnpm --filter @har-analyzer/components check-types
  • pnpm --filter @har-analyzer/components build

Contributing

Contributions are welcome. Please open an issue or pull request:

  • https://github.com/theallanjoshua/har-analyzer