# gkz/grasp

JavaScript structural search, replace, and refactor

Repository: https://github.com/gkz/grasp
Canonical: https://ross.abutalabs.com/products/grasp
Homepage: http://graspjs.com
Language: LiveScript
License: MIT
License Family: permissive
Last push: 2017-06-29T08:14:12+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 4758, "days_push": 3352, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1282, forks 33 (observed 2026-08-28T04:04:14.000745+00:00)

## What it is
Grasp is a command-line utility for structural search, replace, and refactoring of JavaScript code based on its abstract syntax tree rather than text. It supports CSS-style selector queries (squery) and example-based queries with wildcards (equery), and can also be used as a library.

## Use cases
- find all usages of a variable in javascript code
- refactor javascript code structurally instead of with grep and sed
- search javascript ast with css-like selectors
- replace function call arguments across a codebase
- find if statements with compound conditions
- run codemods on javascript files from the command line

## When to choose
- you need structure-aware search or replacement in JavaScript that ignores formatting differences
- you want to write quick one-line codemods or macros from the terminal
- you prefer CSS-style selectors or code examples with wildcards over regex

## When to avoid
- you need to refactor languages other than JavaScript
- you want an actively maintained tool with modern ES2020+ support
- you need IDE-integrated refactoring rather than a CLI

## Facets
- artifact type: cli-tool
- maturity: maintenance
- function: search-engine, parser, developer-tools, cli
- domain: developer-tools, parsers, web-development
- platform: cli, cross-platform
- tags: ast, structural-search, code-refactoring, codemod, javascript, livescript, command-line, nodejs

## Member repositories
- gkz/grasp (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:14.000745+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:57:42.069894+00:00, confidence not recorded.
  - readme: https://github.com/gkz/grasp (fetched 2026-08-28T04:04:14.000745+00:00, sha 37ccae70ad6c)
  - homepage: http://graspjs.com (fetched 2026-08-29T12:12:53.509075+00:00, sha 34d0bef1d137)
  - site_page: http://www.graspjs.com/docs (fetched 2026-08-29T12:12:53.518373+00:00, sha 78cb42a497c0)
  - site_page: http://www.graspjs.com/docs/install (fetched 2026-08-29T12:12:53.520635+00:00, sha a306b778d701)
  - site_page: http://www.graspjs.com/docs/concepts (fetched 2026-08-29T12:12:53.522137+00:00, sha 033af30371b2)
  - site_page: http://www.graspjs.com/docs/options (fetched 2026-08-29T12:12:53.523837+00:00, sha 31729a12ea44)
  - site_page: http://www.graspjs.com/docs/syntax-js (fetched 2026-08-29T12:12:53.525647+00:00, sha 6951679d429a)
  - site_page: http://www.graspjs.com/docs/equery (fetched 2026-08-29T12:12:53.527402+00:00, sha e61b4e59f225)
  - site_page: http://www.graspjs.com/docs/squery (fetched 2026-08-29T12:12:53.529012+00:00, sha 9a6eb04a59d7)
  - site_page: http://www.graspjs.com/docs/replace (fetched 2026-08-29T12:12:53.530747+00:00, sha 439c2eb16432)
- Data as of 2026-08-30T08:39:29.467469+00:00.
