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

@gjuoun/ast-grep

v0.45.2

Published

npm binary distribution of ast-grep (ast-grep/ast-grep) v0.45.2, platform packages resolved via optionalDependencies

Readme

@gjuoun/ast-grep

npm License: MIT

npm binary distribution of ast-grep — install ast-grep as an npm dependency, no system install, no postinstall, no runtime download. Modeled after @vscode/ripgrep (and its sibling, @gjuoun/fd).

Use it when your tool, CLI, or agent needs ast-grep (structural search/lint/rewrite for code, powered by tree-sitter) on any machine where it is not installed — lean clients, containers, CI, remote hosts. npm install is the only setup step.

Install

npm install @gjuoun/ast-grep
# or
bun add @gjuoun/ast-grep

npm automatically installs exactly one platform package matching your os/cpu (via optionalDependencies); nothing is downloaded at runtime.

Usage

Get the binary path

import { astGrepPath } from "@gjuoun/ast-grep";

console.log(astGrepPath);
// → /path/to/node_modules/@gjuoun/ast-grep-darwin-arm64/bin/ast-grep

Run ast-grep from your code

import { spawnSync } from "node:child_process";
import { astGrepPath } from "@gjuoun/ast-grep";

const result = spawnSync(astGrepPath, ["run", "-p", "console.log($$$)", "-l", "js"], {
  encoding: "utf8",
});
console.log(result.stdout); // matching code

CommonJS works too

const { astGrepPath } = require("@gjuoun/ast-grep");

API

export const astGrepPath: string;

| Export | Type | Description | |---|---|---| | astGrepPath | string | Absolute path to the ast-grep binary for the current platform (via require.resolve against the matching platform package). |

Throws Error at import time if no platform package matches the current process.platform / process.arch — the message names the expected package and the npm install -O <pkg> fix. Upstream ast-grep ships glibc (gnu) builds only on Linux — there is no musl package to fall back to on Alpine/musl hosts (unlike @gjuoun/fd).

Platform packages

| Package | os | cpu | libc | |---|---|---|---| | @gjuoun/ast-grep-darwin-arm64 | darwin | arm64 | — | | @gjuoun/ast-grep-darwin-x64 | darwin | x64 | — | | @gjuoun/ast-grep-linux-arm64 | linux | arm64 | glibc | | @gjuoun/ast-grep-linux-x64 | linux | x64 | glibc |

No musl packages: upstream ast-grep v0.45.2 publishes gnu (glibc) Linux builds only. No Windows packages: scoped out, mirroring @gjuoun/fd's Unix-only footprint (upstream does publish *-pc-windows-msvc assets — add packages for them if Windows support is ever needed).

Development

Binaries are not committed. Rebuild them from the pinned upstream release, then test:

bun scripts/fetch.ts   # download + verify against GitHub API sha256 digest + unpack
bun test               # unit + resolver tests
bun scripts/pack-check.ts

ast-grep publishes no checksums.txt manifest, so fetch.ts verifies each downloaded app-<target>.zip against the sha256 digest reported by the GitHub Releases API (GET /repos/ast-grep/ast-grep/releases/tags/<tag>, per-asset digest field) instead of a downloaded checksums file, then pins that value into versions.json.

License

MIT © Jun Guo