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

daemond

v0.1.2

Published

Seed launcher script for idempotent local command daemons

Readme

daemond

Minimal seed launcher for repeatable command execution in a sandbox.

daemond exports three APIs:

  • daemonSeedScript(...)
  • daemonSeedScriptCommand(...)
  • parseSeedInvocationOutput(...)

It returns a self-contained node -e launcher script that:

  • boots or reuses a small local daemon (Unix socket)
  • keeps a stable token per workspace daemon
  • runs one command request
  • returns a JSON envelope with stdout, stderr, combined, and daemon metadata
  • exposes event streaming over socket (subscribe) and SSE

Install

npm install daemond

API

import { daemonSeedScript, daemonSeedScriptCommand } from "daemond";
  • daemonSeedScript({ name?, socket? })
    • name defaults to daemond-seed
    • socket defaults to /tmp/.computesdk/seed-sockets/<hash>.sock
  • daemonSeedScriptCommand(config, payload)
    • builds a shell-safe node -e ... command string
    • payload can be a plain command string (for example "pwd") or a JSON command object
  • parseSeedInvocationOutput(stdout)
    • parses seed launcher stdout into the typed invocation result
    • reads the last non-empty stdout line as JSON

Basic usage

import { daemonSeedScript } from "daemond";

const script = daemonSeedScript({ name: "seed-control" });

// Host/sandbox side example:
// node -e "<script>" "pwd"
// node -e "<script>" '{"command":"node","args":["-v"]}'

import { daemonSeedScriptCommand, parseSeedInvocationOutput } from "daemond";

const cmd = daemonSeedScriptCommand(
  { name: "seed-control" },
  { command: "node", args: ["-v"] },
);
// pass `cmd` directly to sandbox.runCommand(cmd)

const rawStdout = '{"token":"...","requestId":"...","daemon":{"reused":true,"pid":1234,"sseUrl":"..."},"command":{"exitCode":0,"stdout":"v22.0.0\\n","stderr":"","combined":"v22.0.0\\n"}}\n';
const parsed = parseSeedInvocationOutput(rawStdout);

Example output (single JSON line on stdout):

{
  "token": "...",
  "requestId": "req-...",
  "daemon": {
    "reused": true,
    "pid": 1234,
    "sseUrl": "http://127.0.0.1:33937/events?token=..."
  },
  "command": {
    "exitCode": 0,
    "signal": null,
    "stdout": "...",
    "stderr": "",
    "combined": "..."
  }
}

Socket protocol

The daemon speaks newline-delimited JSON over its Unix socket.

Supported message types:

  • health (no auth required)
  • exec (requires token)
  • subscribe / unsubscribe (requires token)
  • stop (requires token)

SSE stream endpoint:

  • GET /events?token=<token>

Emitted events include:

  • command.started
  • command.stdout
  • command.stderr
  • command.exit

Development

npm run build
npm run typecheck
npm run test:integration
npm run test:integration:docker

Docker validation

test:integration:docker validates the seed launcher flow inside a containerized sandbox powered by @computesdk/docker.

  • runtime: node
  • image: node:22-bookworm
  • assertion focus: stable daemon token reuse and successful repeated command execution

CI runs this in a dedicated validate-docker-seed job after offline integration tests.

Scope

  • Linux-only today (Unix socket)
  • Local process model
  • Runtime state under /tmp/.computesdk