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

@peavy-log/web

v1.0.3

Published

Peavy remote logging library for web

Readme

Peavy Web/TypeScript Library

Installation

npm install @peavy-log/web

Usage

import { Peavy, LogLevel } from '@peavy-log/web';

// Initialize
Peavy.init({
  endpoint: 'https://my-endpoint.com',
  logLevel: LogLevel.Info,
  printToConsole: true,
});

Logging

// Simple logging
Peavy.t('Trace message'); // Trace
Peavy.d('Debug message'); // Debug
Peavy.i('Info message', {
  extra: 'data',
}); // Info
Peavy.w('Warning message'); // Warning
Peavy.e('Error message'); // Error

// Logging with errors
try {
  // some code
} catch (error) {
  Peavy.e('Operation failed', error);
}

// Advanced logging with custom builder
Peavy.log((builder) => {
  builder.level = LogLevel.Warning;
  builder.message = 'Custom log message';
  builder.json = { customField: 'value' };
});

Events

Track user actions and state changes.

State changes are events that represent a persistent configuration or mode of the application changing. Examples include changing dark mode/theme/colors or enabling/disabling a feature.

import { Peavy } from '@peavy-log/web';

// Track a user action
Peavy.action('user', 'login', 1200, EventResult.Success);
Peavy.action('qr', 'open');

// Track state events
Peavy.state('<category>', '<name>', '<value>');
Peavy.state('app', 'persistence', 'indexeddb');

Metadata

Add persistent metadata to all logs. This persists across sessions (using localstorage).

This should be used sparingly, and only for data that is relevant for all logs and events, and which is not available or inferrable elsewhere.

Versions are automatically managed, so need not be added. The same goes for environment and global app info.

// Set metadata
Peavy.setMeta({
  userId: '12345',
});

// Clear metadata
Peavy.clearMeta();

Integrations

Axios

If you're using axios, you can use the Peavy's interceptors to automatically log requests and responses, plus add tracing headers the requests.

import axios from 'axios';
import {
  peavyRequestInterceptor,
  peavyResponseInterceptor,
  peavyErrorInterceptor,
} from '@peavy-log/web/integrations/axios';

axios.interceptors.request.use(peavyRequestInterceptor);
axios.interceptors.response.use(peavyResponseInterceptor, peavyErrorInterceptor);