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

@clawsjoy/dsh-session-retention

v0.1.1

Published

Never front-truncate a DSH session log: keeps logs whole by default and treats the size cap as opt-in, because a rotated log cannot be loaded (seq gap in committed region).

Readme

@clawsjoy/dsh-session-retention

The DSH jsonl session backend with the size-cap rotation neutralised by default.

Why

DSH's jsonl backend rotates a log that crosses maxLogBytes (50 MiB default) by renaming it aside and re-materialising a header-only live file. The live log therefore continues from a non-zero seq, and the session loader refuses such a log:

corrupt session log: seq gap in committed region at line 1
(expected 0, got 5528588)

Measured on a real session (2026-09-22): the session stayed listable but unopenable — the worst kind of failure, because nothing in the UI or the logs explains it. Repair required splicing the archived half back in by hand.

What this plugin does

It extends JsonlSessionPersistence and changes exactly one thing: the maxLogBytes handed to the backend.

| | upstream jsonl | this plugin | |---|---|---| | size cap | 50 MiB, rotation | effectively unlimited (1 TiB) unless you opt in | | whole-session count cap (maxSessionsPerProject) | inherited | inherited (safe: prunes whole sessions, never truncates a log) | | everything else (service key, config schema, create/append/load/repair) | — | inherited |

Opting back into rotation is a deliberate, documented choice: set maxLogBytes explicitly and it is honoured (the log line in retention.reason records that it was an opt-in).

Install

dsh plugin --profile web add @clawsjoy/dsh-session-retention
- id: session-persistence-jsonl
  disabled: true
- insert:
    - id: session-retention
      name: '@clawsjoy/dsh-session-retention'
      config:
        root: !!js dshHomePath('sessions')
        # maxSessionsPerProject: 50    # whole-session pruning (safe)
        # maxLogBytes: 209715200       # opt in to rotation — see "Why" first

Verification

pnpm test

The suite's negative control asserts the upstream default would rotate a 65 MiB log — the size that actually broke a session — while this plugin's resolved cap does not.

License

MIT