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

@profitstone/pstone

v0.1.2

Published

Profit Stone Telemetry SDK for Node.js / TypeScript — OpenTelemetry instrumentation for AI apps

Readme

@profitstone/pstone

Profit Stone in-process Telemetry SDK for Node.js and TypeScript.

OpenTelemetry-based collection of LLM calls, sent to the Profit Stone SaaS Ingest API (same contract as the Python pstone package).

npm install @profitstone/pstone
# optional peers for auto-instrumentation:
npm install openai @anthropic-ai/sdk
import { pstone } from "@profitstone/pstone";
import OpenAI from "openai";

pstone.init(process.env.PSTONE_API_KEY!);

const client = new OpenAI();
const resp = await client.chat.completions.create({
  model: "gpt-4o-mini",
  messages: [{ role: "user", content: "Hello" }],
});

await pstone.flushAsync();
await pstone.shutdownAsync();

0.2.0 — init / OTLP protobuf export / OpenAI & Anthropic instrumentation (parity with Python MVP).

Requirements

  • Node.js 18+

Environment

| Variable | Required | Description | |----------|----------|-------------| | PSTONE_API_KEY | recommended | Workspace API Key if omitted from init | | PSTONE_INGEST_URL | optional | Ingest base URL (default https://api.profitstone.ai) | | PSTONE_SERVICE_NAME | optional | OTel service.name (default pstone-app) |

Traces are sent to {PSTONE_INGEST_URL}/v1/ingest/traces with Authorization: Bearer <key> (OTLP/HTTP protobuf).

API

| Method | Purpose | |--------|---------| | pstone.init(apiKey?, options?) | Start tracer + optional auto-instrument | | pstone.flush() / flushAsync() | Force export of pending spans | | pstone.shutdown() / shutdownAsync() | Uninstrument + shut down provider | | pstone.wrapOpenai(client) | Wrap one OpenAI client instance | | pstone.wrapAnthropic(client) | Wrap one Anthropic client instance |

init options

| Option | Default | Description | |--------|---------|-------------| | ingestUrl | env / SaaS default | Ingest base URL | | serviceName | pstone-app | Resource service.name | | captureContent | true | Include prompts/completions | | redact | true | Basic email/phone redaction | | instrument | true | Auto-patch OpenAI / Anthropic if installed | | instrumentOpenai | true | Patch OpenAI | | instrumentAnthropic | true | Patch Anthropic | | useBatch | true | BatchSpanProcessor (false for tests) | | exporter | OTLP protobuf | Inject custom exporter (tests) |

Instrumentation

With instrument: true (default), when packages are installed:

  • OpenAI — chat.completions.create (+ parse / responses.create when present), including stream: true
  • Anthropic — messages.create, including stream: true

Or wrap a single client: pstone.wrapOpenai(client).

Local smoke (optional)

export PSTONE_API_KEY=psk_...
export PSTONE_INGEST_URL=http://localhost:8000
node -e "
import { pstone } from '@profitstone/pstone';
import { startLlmSpan, recordLlmResponse } from '@profitstone/pstone';
pstone.init(undefined, { useBatch: false, instrument: false });
const s = startLlmSpan({ system: 'openai', model: 'smoke', prompt: 'hi' });
recordLlmResponse(s.span, { completion: 'ok', inputTokens: 1, outputTokens: 1 });
s.end();
await pstone.flushAsync();
await pstone.shutdownAsync();
console.log('flushed');
"

License

MIT