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 🙏

© 2025 – Pkg Stats / Ryan Hefner

inspect-log-viewer

v0.3.113-beta4

Published

Log viewer for inspect_ai logs.

Readme

Inspect Log Viewer

React tools for viewing eval logs produced by Inspect-AI.

Installation

npm install @meridianlabs/log-viewer

CSS Requirements

The log viewer requires CSS styles to display correctly. Import the bundled styles:

import "@meridianlabs/log-viewer/styles/index.css";

This includes all required dependencies (Bootstrap, Bootstrap Icons, Prism.js themes).

Example Usage

import { useEffect, useState } from "react";
import {
    App as InspectApp,
    createViewServerApi,
    clientApi,
    initializeStore,
    ClientAPI,
    Capabilities,
} from "@meridianlabs/log-viewer";
import "@meridianlabs/log-viewer/styles/index.css";

export function App() {
    const [api, setApi] = useState<ClientAPI | null>(null);

    useEffect(() => {
        async function initializeApi() {
            // Get log directory from URL parameter
            const urlParams = new URLSearchParams(window.location.search);
            const logDir = urlParams.get("log_dir");

            if (!logDir) {
                console.error("Missing log_dir URL parameter");
                return;
            }

            // Create API instance
            const viewServerApi = createViewServerApi({
                // optional params
                logDir: logDir,
                apiBaseUrl: "https://mycompany.com/api",
            });
            const clientApiInstance = clientApi(viewServerApi);

            // Set up capabilities and storage
            const capabilities: Capabilities = {
                downloadFiles: true,
                webWorkers: true,
                streamSamples: true,
                streamSampleData: true,
                nativeFind: false,
            };

            // Initialize store and set API
            initializeStore(clientApiInstance, capabilities, undefined);
            setApi(clientApiInstance);
        }

        initializeApi();
    }, []);

    if (!api) {
        return <div>Loading...</div>;
    }

    return <InspectApp api={api} />;
}

Developing

The Inspect log viewer is built into a bundled JS file using vite. For users who clone or install from the repo directly, we keep a bundled version committed in the dist folder. When you make changes, your commits/PRs must include updates to the bundled files in the dist folder as well as the source code changes.

Before You Commit:

Run these commands in the src/inspect_ai/_view/www directory:

  1. Lint code:

    yarn lint

    Fix any errors reported.

  2. Format code:

    yarn prettier:write
  3. Build for library distribution:

    yarn build:lib
  4. Build bundled output for the dist directory:

    yarn build

    Don't forget to stage newly updated changes in the dist folder.

You may optionally set the VIEW_SERVER_API_URL environment variable at build time to use an API server running on a different host.