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

pi-clojure

v1.1.0

Published

A set of Clojure development tools implemented in pure JavaScript for the [pi-coding-agent](https://github.com/badlogic/pi-mono).

Downloads

226

Readme

pi-clojure

A set of Clojure development tools implemented in pure JavaScript for the pi-coding-agent.

Why this project?

Existing solutions for Clojure evaluation in AI coding agents (e.g., clojure-mcp, clojure-mcp-light) either:

  • Introduce the overhead of MCP (Model Context Protocol) as an additional communication layer
  • Rely on CLI tools for execution, which adds process spawn overhead

These approaches can create performance bottlenecks, especially on resource-constrained systems. Additionally, MCP introduces complexity in setup and maintenance.

This project takes a different approach: implementing Clojure evaluation as native pi tools that communicate directly with nREPL via TCP sockets. This eliminates any middleware layer, providing:

  • Zero overhead: Direct tool invocation without MCP protocol translation
  • Direct execution: Code evaluated directly via nREPL without CLI process spawning overhead
  • Simpler architecture: No external dependencies or protocol adapters

Installation

pi install npm:pi-clojure

Tools

| Tool | Description | |------|-------------| | clojure_eval | Evaluates Clojure code via nREPL | | clojure_find_nrepl_port | Finds nREPL port by checking port files or trying default ports | | clojure_paren_repair | Fixes unbalanced delimiters in Clojure/ClojureScript/Babashka code. Standalone — no nREPL required. |

clojure_eval

Evaluates Clojure code via nREPL.

Note: Requires an existing nREPL connection. Use clojure_find_nrepl_port to find a running nREPL, or start one manually.

Features

  • Evaluates Clojure code via nREPL protocol
  • Supports custom namespaces
  • Handles stdout/stderr output

Configuration

Default nREPL Ports

The extension auto-detects nREPL on these ports:

  • 7888, 1666, 50505, 58885, 63333, 7889
Parameters

| Parameter | Type | Description | |-----------|------|-------------| | code | string | Clojure code to evaluate | | port | number | nREPL port (required) | | host | string | nREPL host (default: localhost) | | ns | string | Target namespace |

Usage

Start nREPL in your Clojure project:

clj -M:nrepl

Then use the clojure_eval tool in pi-coding-agent to evaluate code.

clojure_find_nrepl_port

Finds the nREPL port by checking for port files in the current directory or trying common default ports. Validates the connection by evaluating (+ 1 1).

Features

  • Checks for common nREPL port files:
    • .nrepl-port
    • nrepl-port
    • .shadow-cljs/nrepl.port
    • .cider-nrepl.port
  • Falls back to default ports: 7888, 1666, 50505, 58885, 63333, 7889
  • Validates by connecting and evaluating (+ 1 1)

Parameters

None.

Usage

;; Find the nREPL port
(clojure_find_nrepl_port {})
;; Returns: Found nREPL port 7888 at localhost:7888

clojure_paren_repair

Fixes unbalanced delimiters in Clojure, ClojureScript, and Babashka code using parinfer. Standalone tool — does not require nREPL or any running process.

Works with all Clojure-type source files: .clj, .cljs, .cljc, .bb

Features

  • Works with Clojure, ClojureScript, and Babashka
  • Detects unbalanced (, [, {, ), ], }
  • Auto-inserts missing closing delimiters
  • Handles strings, comments, and escape sequences
  • Built on parinfer (pure JS, no native dependencies)

Parameters

| Parameter | Type | Description | |-----------|------|-------------| | code | string | Clojure code with potentially unbalanced delimiters | | check | boolean | (optional) Only check if balanced, don't fix |

Usage

;; Fix unbalanced delimiters
(clojure_paren_repair { code: "(defn foo [x]" })
;; Returns: Fixed delimiters:
;; ```clojure
;; (defn foo [x])
;; ```

;; Check if balanced (without fixing)
(clojure_paren_repair { code: "(defn foo [x])", check: true })
;; Returns: Code has balanced delimiters

Examples

| Input | Output | |-------|--------| | (defn foo [x] | (defn foo [x]) | | ((foo [bar] [baz] | ((foo [bar] [baz])) | | (defn foo [x y] x) | (defn foo [x y] x) (no change) |

License

EPL-2.0

Copyright © 2026-present Marko Kocic [email protected]