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

greply

v0.1.13

Published

Node wrapper around the 'greply' bash CLI for use in MCP servers and apps.

Readme

greply

Small Node.js wrapper around the greply CLI for programmatic use (e.g. MCP servers).

Install CLI

Install latest from main branch

wget

wget -O - https://raw.githubusercontent.com/AnthonyRuffino/greply/main/install.sh | bash

curl

curl -sSL https://raw.githubusercontent.com/AnthonyRuffino/greply/main/install.sh | bash

Install

npm i greply
# or
pnpm add greply

Requires Node 18+. By default the wrapper prefers its bundled greply.sh (shipped in this package). If not present, it falls back to greply on PATH. You can override with greply_CMD=/path/to/greply or the greplyCmd option.

Usage

import { greplyRun, greplyHelp } from "greply";

const { stdout } = await greplyRun({
  query: "TODO",
  target: ".",
  before: 1,
  after: 1,
  recursive: true,
  fixedStrings: true
});
console.log(stdout);

// Usage text
const help = await greplyHelp();
console.log(help.stdout || help.stderr);

Quick local test against the bundled README

Relative Path Handling:

Uses relative path 'node_modules/greply/README.md' directly.

Command:
node -e '
  import("greply")
    .then(m => 
      m.greplyRun({ query: "m.greplyRun", target: "README.md", fixedStrings: true })
        .then(r => console.log(r.stdout))
    )
'
Output:
README.md:46:      m.greplyRun({ query: "greplyRun", target: "README.md", fixedStrings: true })
README.md:53:...

Absolute Path Handling:

Uses path.resolve(process.cwd(), 'node_modules/greply/README.md') to create an absolute path

Command:
node -e '
  import("greply")
    .then(g => 
      import("node:path")
        .then(p => p.resolve(process.cwd(), "README.md"))
        .then(f => 
          g.greplyRun({ query: "g.greplyRun", target: f, fixedStrings: true })
        )
        .then(r => console.log(r.stdout))
    )
'
Output:
README.md:68:          g.greplyRun({ query: "PATH", target: f, fixedStrings: true })
README.md:77:...

Environment setup from source

rm -rf /tmp/greply-test && mkdir -p /tmp/greply-test && cd /tmp/greply-test
git clone [email protected]:AnthonyRuffino/greply.git
cd greply
npm pack
cd ..
cp greply/greply-{release}.tgz .
npm i greply-{release}.tgz

Installing the cli (optional)

  • Install using the bundled script from node_modules (no network). The programmatic install() copies the included greply.sh to a destination and marks it executable. By default, it writes to ~/.local/bin/greply and prompts before overwrite.

If you do not want to install greply directly, you can use the bash script bundled with the npm packacge with the following usage:

/node_modules/greply/greply.sh -c PATH  node_modules/greply/README.md

To install as executable bash script ~/.local/bin/greply

node -e "import('greply').then(m => m.install())"

When you need control:

node -e "(async()=>{ const m=await import('greply'); await m.install(); })()"

Quick Install Script

Download and run the install script in one command:

Install Script Parameters:

  • First parameter: wget (direct download) or npm (clone + build)
  • Second parameter: version tag (optional, e.g., "0.1.0", "1.0.0")
  • Defaults: wget method, latest from main branch if no version specified

Install latest from main branch

wget -O - https://raw.githubusercontent.com/AnthonyRuffino/greply/main/install.sh | bash

Install specific version

wget -O - https://raw.githubusercontent.com/AnthonyRuffino/greply/main/install.sh | bash -s wget 0.1.5

Install via npm method with version

wget -O - https://raw.githubusercontent.com/AnthonyRuffino/greply/main/install.sh | bash -s npm 0.1.5

Options → greply flags

Usage: ./node_modules/greply/greply.sh [options] <search_string> <file_or_directory>

  • before → -B
  • after → -A
  • recursive → -R
  • wholeWord → -w
  • matchCase → -c
  • fixedStrings → -F
  • greplyCmd → custom path/command for greply
  • suppressErrors → return stdout/stderr even if exit code ≠ 0

Usage once installed: greply [options] <search_string> <file_or_directory> e.g.

greply -c PATH  node_modules/greply/README.md