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

@caido-utils/frontend-sdk

v0.1.0

Published

Composables and utilities for Caido plugin frontends.

Downloads

159

Readme

@caido-utils/frontend

Composables and utilities for Caido plugin frontends.

Installation

pnpm add @caido-utils/frontend

Peer dependencies: vue, primevue, @caido/sdk-frontend, @codemirror/view

import { useFrontend, useReplay, getRequestId } from "@caido-utils/frontend";

For Vue components, see @caido-utils/components.


Composables

useFrontend

Caido editor utilities.

const {
  getEditorContent,
  setEditorContent,
  getSelectedText,
  getReplayRequestId,
} = useFrontend(sdk);

Returns

| Method | Signature | Description | | -------------------- | ---------------------------------------------------- | ------------------------------------------ | | getEditorView | (showErrors?: boolean) => EditorView \| undefined | Get active CodeMirror editor view | | getEditorContent | () => string \| undefined | Get active editor text content | | getSelectedText | () => string \| undefined | Get selected text in editor | | setEditorContent | (content: string, showErrors?: boolean) => boolean | Replace editor content | | getReplayRequestId | () => string \| undefined | Get request ID from current replay session |


useEditor

CodeMirror editor management (SDK-independent).

const { updateEditor, clearEditor, scrollToPosition } = useEditor(
  () => editorViewRef.value,
);

Returns

| Method | Signature | Description | | ------------------ | ----------------------------------------- | -------------------------------------------- | | updateEditor | (content: string) => Promise<void> | Replace editor content (skips if unchanged) | | clearEditor | () => void | Clear editor content | | scrollToPosition | (line: number, column?: number) => void | Scroll to line (1-based) and optional column |


useReplay

Send requests to Caido's Replay tab.

const { sendToReplay, sendRequestToReplay } = useReplay(sdk, "My Collection");

Returns

| Method | Signature | Description | | --------------------- | --------------------------------------------------------- | ------------------------------- | | sendToReplay | (url: string, collectionName?: string) => Promise<void> | Create replay session from URL | | sendRequestToReplay | (requestId: string, options?) => Promise<void> | Send existing request to replay |

sendRequestToReplay options:

| Option | Type | Description | | ---------------- | -------- | --------------------------- | | collectionName | string | Override default collection | | sessionName | string | Custom session name |


useStorage

Reactive plugin storage with auto-persistence.

// Inside a Pinia defineStore:
const { data, save } = useStorage(sdk, {
  filter: "",
  pageSize: 100,
});

// data.filter is Ref<string>, data.pageSize is Ref<number>
data.filter.value = "req.host.cont:example.com";
await save();

Returns

| Property | Type | Description | | -------- | ------------------------------- | ----------------------------- | | data | { [K in keyof T]: Ref<T[K]> } | Reactive refs for each key | | save | () => Promise<void> | Persist all values to storage |

Automatically hydrates from existing storage on setup and listens for external changes.


useDialogManager

Generic dialog state manager.

type DialogType = "create" | "edit" | "delete";
const { openDialog, closeDialog, isDialogOpen, getDialogData } =
  useDialogManager<DialogType>();

openDialog("edit", { id: "123" });
isDialogOpen("edit"); // true
getDialogData<{ id: string }>(); // { id: "123" }
closeDialog();

Returns

| Method | Signature | Description | | --------------- | ----------------------------------- | ----------------------------------- | | activeDialog | Ref<{ type, data } \| undefined> | Current dialog state | | openDialog | (type: T, data?: unknown) => void | Open a dialog with optional payload | | closeDialog | () => void | Close active dialog | | isDialogOpen | (type: T) => boolean | Check if specific dialog is open | | getDialogData | <D>() => D \| undefined | Get typed payload of active dialog |


Utilities

getRequestId

Extract a single request ID from a Caido command context.

import { getRequestId } from "@caido-utils/frontend";

sdk.commands.register("my:command", {
  name: "My Command",
  run: (context) => {
    const requestId = getRequestId(context);
  },
});

Supported context types: RequestContext, RequestRowContext (first item), ResponseContext.

getRequestIds

Extract all request IDs from a command context (supports multi-row selection).

import { getRequestIds } from "@caido-utils/frontend";

const ids = getRequestIds(context); // string[]