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

@astuteo/ph-enhancer

v1.0.4

Published

PostHog enhancer utilities for Astuteo projects.

Readme

PostHog Enhancer

A utility for tracking custom user interactions using PostHog.

Installation

npm install @astuteo/ph-enhancer
# or
yarn add @astuteo/ph-enhancer

Build Information

This package uses Rollup to create multiple distribution formats:

  1. UMD (Universal Module Definition): For direct use in browsers via script tags
  2. CommonJS: For Node.js environments
  3. ES Modules: For modern bundlers like webpack, Rollup, or Parcel

The build process creates these files in the dist directory when you run npm run build.

Usage

Basic Setup

import posthog from 'posthog-js';
import tracking from '@astuteo/ph-enhancer';

// Initialize PostHog first
posthog.init('your-posthog-api-key', {
  api_host: 'https://your-posthog-host.com',
});

// Then initialize the tracking module
tracking.init({
  authKey: 'your-auth-key', // Optional: for organization tracking
});

Using Named Exports

You can also import specific functions:

import { trackSearch, trackThemePreference, EVENTS } from '@astuteo/ph-enhancer';

// Track a search event
trackSearch({
  query: 'example search',
  resultsCount: 10,
  category: 'products'
});

// Manually track theme preference
trackThemePreference();

Features

  • Theme Preference Tracking: Automatically tracks user's light/dark mode preference
  • Search Tracking: Track search queries and results
  • Organization Tracking: Track organization information including name and ISP status (requires backend API)

API Reference

Main Methods

  • init(options): Initialize the tracking module
  • cleanup(): Clean up tracking resources (remove event listeners)
  • trackThemePreference(): Track the user's theme preference
  • trackSearch(data): Track search events
  • trackOrganization(authKey): Track organization information

Events

import { EVENTS } from '@astuteo/ph-enhancer';

// Available event types
EVENTS.THEME_PREFERENCE // 'theme_preference'
EVENTS.SEARCH           // 'search'
EVENTS.ORGANIZATION     // 'organization'

License

MIT