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

@forinda/kickjs-devtools-kit

v5.2.0

Published

Types, RPC envelopes, runtime sampler, and memory analyzer used by KickJS DevTools and any plugin that integrates with it

Downloads

1,135

Readme

@forinda/kickjs-devtools-kit

Types, RPC envelopes, runtime sampler, and memory analyzer for KickJS DevTools (architecture.md §23).

Install

pnpm add @forinda/kickjs-devtools-kit

What's in the box

  • IntrospectionSnapshot — the contract every plugin/adapter implements via the introspect() slot on defineAdapter() / definePlugin().
  • defineDevtoolsTab(opts) — declarative tab descriptor (iframe / launch / html views) that plugins ship to surface in the DevTools panel.
  • RuntimeSampler — Tier 1 monitoring (heap, CPU, event-loop, GC) with a ring buffer of recent snapshots for sparkline rendering.
  • MemoryAnalyzer — heap-growth trend (linear regression), GC reclaim ratio, active-handle inventory, composite leak-warning severity.
  • RpcRequest / RpcResponse — transport-agnostic envelope types used by every DevTools RPC channel.
  • PROTOCOL_VERSION — wire-format version stamped on every snapshot so future shape changes don't crash old panels.

Quick example — adapter integration

import { defineAdapter } from '@forinda/kickjs'
import { PROTOCOL_VERSION, type IntrospectionSnapshot } from '@forinda/kickjs-devtools-kit'

let activeWorkers = 0
let pendingJobs = 0

export const QueueAdapter = defineAdapter({
  name: 'QueueAdapter',
  build: (config) => ({
    middleware: () => [
      /* ... */
    ],
    introspect: (): IntrospectionSnapshot => ({
      protocolVersion: PROTOCOL_VERSION,
      name: 'QueueAdapter',
      kind: 'adapter',
      state: { strategy: config.strategy },
      tokens: { provides: ['kick/queue/Manager'], requires: [] },
      metrics: { activeWorkers, pendingJobs },
    }),
  }),
})

introspect() is called on demand by the DevTools topology endpoint. Keep it cheap (counters + flags) — anything that needs a DB round trip belongs behind a separate explicit RPC.

Quick example — runtime monitoring

import { RuntimeSampler, MemoryAnalyzer } from '@forinda/kickjs-devtools-kit/runtime'

const sampler = new RuntimeSampler({ intervalMs: 1000, bufferSize: 60 })
const analyzer = new MemoryAnalyzer()

sampler.start()
analyzer.start()

// Later — in an RPC handler
const latest = sampler.latest() // most recent RuntimeSnapshot
const window = sampler.history() // last 60 snapshots
const health = analyzer.health(window) // composite memory health signal

Why a separate kit package

Plugin authors integrating with DevTools should not need to take a dependency on the DevTools runtime, the panel UI, or any HTTP / WebSocket transport. The kit ships only types + a tiny runtime (sampler + analyzer); zero runtime deps, no peer requirements except @forinda/kickjs itself.

Recommended dependency shape (third-party plugins)

Framework-internal @forinda/kickjs-* adapters list this kit as a regular dependencies entry — lockstep versioning means every release of every package matches, so dedup happens automatically and the ~1KB type install is negligible.

For third-party plugins the recommended shape is peer-optional:

{
  "peerDependencies": {
    "@forinda/kickjs-devtools-kit": ">=3.2.0",
  },
  "peerDependenciesMeta": {
    "@forinda/kickjs-devtools-kit": { "optional": true },
  },
  "devDependencies": {
    "@forinda/kickjs-devtools-kit": "^3.2.0",
  },
}

Why peer-optional:

  • Adopters who don't use DevTools never install the kit — your plugin's devtoolsTabs() / introspect() methods become dead code, never invoked because the DevTools aggregator isn't mounted.
  • Adopters who do use DevTools install the kit at the top of their dependency tree alongside @forinda/kickjs-devtools — version coordination is explicit and deduped.
  • Your plugin still gets full type-checking via the devDependencies entry.

The IntrospectionSnapshot.protocolVersion field (currently 1) means version skew across major bumps is wire-compatible — adopters mixing your plugin's pinned version with a newer kit will keep working as long as both report the same protocol version.

See also