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

@yofriadi/pi-hashline-edit

v0.1.1

Published

```bash pi install git:github.com/yofriadi/pi-extensions@hashline-edit-v<version> ```

Readme

@yofriadi/pi-hashline-edit

Install from git URL

pi install git:github.com/yofriadi/pi-extensions@hashline-edit-v<version>

To load only this extension from the monorepo package source, use package filtering in settings:

{
  "packages": [
    {
      "source": "git:github.com/yofriadi/pi-extensions@hashline-edit-v<version>",
      "extensions": ["packages/hashline-edit/src/index.ts"]
    }
  ]
}

Hashline edit mode for pi — a line-addressable edit format using content hashes.

Overview

Each line in a file is identified by its 1-indexed line number and an 8-char base16 hash derived from the exact line content (except trailing \r). The combined LINE:HASH reference acts as both an address and a staleness check.

Displayed format: LINENUM:HASH|CONTENT
Reference format: "LINENUM:HASH" (e.g. "5:a3f19c2e")

Usage

import {
  computeLineHash,
  formatHashLines,
  applyHashlineEdits,
  parseLineRef,
} from "@yofriadi/pi-hashline-edit";

// Format file content with hashline prefixes
const content = "function hello() {\n  return 'world';\n}";
const formatted = formatHashLines(content);
// "1:a3f19c2e|function hello() {\n2:5b0ea94c|  return 'world';\n3:0f8a2c11|}"

// Compute hash for a single line
const hash = computeLineHash(1, "function hello() {");

// Apply edits with hash verification
const result = applyHashlineEdits(content, [
  { set_line: { anchor: "2:5b0ea94c", new_text: "  return 'universe';" } },
]);

Edit Operations

  • set_line: Replace a single line
  • replace_lines: Replace a contiguous range of lines
  • insert_after: Add new content after an anchor line

Note: replace payloads are intentionally not handled by applyHashlineEdits; they should be processed by a separate replace-mode flow.

API

| Function | Description | |----------|-------------| | computeLineHash(idx, line) | Compute short hash for a line | | formatHashLines(content, startLine?) | Format content with LINE:HASH\| prefixes | | applyHashlineEdits(content, edits) | Apply hashline edits with validation | | parseLineRef(ref) | Parse "LINE:HASH" string to {line, hash} | | validateLineRef(ref, fileLines) | Validate hash matches current content | | streamHashLinesFromUtf8(source, options?) | Stream hashline output from bytes | | streamHashLinesFromLines(lines, options?) | Stream hashline output from lines |

License

MIT