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

tinytsdk

v0.4.0

Published

TinyTrack SDK — WebSocket client + React components for system metrics

Downloads

498

Readme

tinytsdk

JavaScript/TypeScript SDK for the TinyTrack monitoring system.

Packages

| Entry point | Contents | |-------------|----------| | tinytsdk | Core WebSocket client + protocol parser (no framework deps) | | tinytsdk/react | React components + TinyTrackProvider context |

Installation

npm install tinytsdk

Vanilla JS / TypeScript

import { TinyTrackClient, RING_L1 } from 'tinytsdk';

const client = new TinyTrackClient('ws://localhost:4026');

client.on('metrics', m => {
  console.log(`CPU: ${m.cpu / 100}%  MEM: ${m.mem / 100}%`);
});

client.on('open', () => {
  // request history from L1 ring (last 60 samples)
  client.getHistory(RING_L1, 60);
  // set push interval to 5 seconds
  client.setInterval(5000);
});

client.connect();

CDN (browser)

<script type="module">
  import { TinyTrackClient } from 'https://cdn.jsdelivr.net/npm/tinytsdk/dist/index.esm.js';
  const client = new TinyTrackClient('ws://your-server:4026');
  client.on('metrics', m => console.log(m));
  client.connect();
</script>

React

import { TinyTrackProvider, useTinyTrack, MetricsPanel } from 'tinytsdk/react';

function App() {
  return (
    <TinyTrackProvider url="ws://localhost:4026">
      <Dashboard />
    </TinyTrackProvider>
  );
}

function Dashboard() {
  const { metrics, connected } = useTinyTrack();
  return (
    <>
      <p>Status: {connected ? 'connected' : 'disconnected'}</p>
      <MetricsPanel />
    </>
  );
}

API

TinyTrackClient

const client = new TinyTrackClient(url, options?);

| Option | Type | Default | Description | |--------|------|---------|-------------| | reconnect | boolean | true | Auto-reconnect on close | | reconnectDelay | number | 2000 | Delay between reconnects (ms) | | maxRetries | number | 0 | Max retries (0 = unlimited) | | path | string | '/websocket' | WebSocket path |

Methods:

| Method | Description | |--------|-------------| | connect() | Open WebSocket connection | | disconnect() | Close connection | | getSnapshot() | Request current metrics snapshot | | getStats() | Request ring buffer statistics | | setInterval(ms) | Change push interval | | getHistory(level, maxCount?, fromTs?, toTs?) | Request historical data | | subscribe(level, intervalMs?) | Subscribe to a ring level | | on(event, fn) / off(event, fn) | Add/remove event listener |

Events: open, close, error, metrics, config, ack, stats, history

Metrics fields (TtMetrics)

| Field | Type | Description | |-------|------|-------------| | timestamp | number | ms since epoch | | cpu | number | CPU usage × 100 (e.g. 5000 = 50%) | | mem | number | Memory usage × 100 | | netRx / netTx | number | Network bytes/sec | | load1 / load5 / load15 | number | Load average × 100 | | nrRunning / nrTotal | number | Process counts | | duUsage | number | Disk usage × 100 | | duTotal / duFree | number | Disk bytes |

Ring levels

| Constant | Value | Resolution | Retention | |----------|-------|------------|-----------| | RING_L1 | 1 | 1 second | 1 hour | | RING_L2 | 2 | 1 minute | 24 hours | | RING_L3 | 3 | 1 hour | 7 days |

Development

npm test          # run tests
npm run build     # build dist/