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

@plurnk/plurnk-hooks

v2.0.1

Published

Deliver selected Plurnk lifecycle events to exact local commands.

Readme

@plurnk/plurnk-hooks

First-party local command hooks for Plurnk. The module selects existing core lifecycle events and delivers each hook as JSON to one exact executable on stdin. It does not define another event bus or invoke a shell.

Configure

Put the following in $XDG_CONFIG_HOME/plurnk/.env (normally ~/.config/plurnk/.env):

PLURNK_HOOKS_COMMAND=/usr/bin/node
PLURNK_HOOKS_ARGS=["/absolute/path/to/plurnk-hook.mjs"]
PLURNK_HOOKS_EVENTS=Stop,PermissionRequest,Notification

PLURNK_HOOKS_ARGS is a JSON string array. Supported names are PreToolUse, PostToolUse, PostToolUseFailure, Stop, Notification, and PermissionRequest. These follow common agent-hook conventions; there is no portable hook standard or vendor configuration-file loader.

Each process receives one line such as:

{"hook_event_name":"Stop","session_id":"7","plurnk":{"workspaceId":42,"method":"loop/terminated","params":{"workerId":7,"loopId":9,"result":{"status":200}}}}

session_id identifies the owning worker. Tool hooks include tool_use_id, tool_name, tool_input, and, after settlement, tool_response; cwd is included when the operation has a project root. plurnk retains the original core event unchanged. PostToolUse reports settled dispatch, not a background process's exit. Stop reports loop termination, never a parked wait or client disconnect. Standard output and error are inherited from the daemon. A spawn, stdin, nonzero-exit, signal, or timeout failure is reported to daemon diagnostics without changing loop control flow. All hooks are asynchronous notifications: neither output nor an exit code can block, approve, or rewrite work, including at PreToolUse or PermissionRequest. Payloads may contain project or model content; treat the command and any downstream sink as trusted.

By default, commands run one at a time with up to 64 waiting events and a 30-second deadline from admission. Queue overflow and deadline expiry are reported; neither blocks the agent. Adjust PLURNK_HOOKS_CONCURRENCY, PLURNK_HOOKS_QUEUE_LIMIT, and PLURNK_HOOKS_TIMEOUT_MS through the same environment cascade. Delivery is best-effort, without retries or replay.

Test one hook

Save this as the script path named in PLURNK_HOOKS_ARGS:

let input = "";
process.stdin.setEncoding("utf8");
for await (const chunk of process.stdin) input += chunk;
const event = JSON.parse(input);
process.stdout.write(`${event.hook_event_name} workspace=${String(event.plurnk.workspaceId)}\n`);

Test it before restarting the daemon:

printf '%s\n' '{"hook_event_name":"Stop","session_id":"7","plurnk":{"workspaceId":42,"method":"loop/terminated","params":{"workerId":7}}}' \
  | /usr/bin/node /absolute/path/to/plurnk-hook.mjs

Module or external tool?

An ordinary executable needs only the configuration above. An installed daemon module can instead use ApplicationPort.subscribeToEvents directly. Both observe the same core events; modules can consume events beyond the command adapter's vocabulary. Producer modules implement stop() to refuse new work and settle existing work; observers unsubscribe in close(), after producer settlement. See the module contract.

The complete delivery contract lives in SPEC.md. Portable defaults live in .env.defaults.