Skip to main content
@jssg/utils provides reusable helpers for JSSG codemods. Open the page for the language of the AST you are transforming.

When to use @jssg/utils

Do not hand-roll these if a helper already exists. Before writing custom import/style/binding logic, read npx codemod ai docs jssg-utils (or the MCP jssg-utils-instructions resource) and prefer the helpers below. Hand-rolled import pattern lists and bare identifier renames are a smell: they miss aliases, alternate quote styles, require(), and type-only imports, and they create false positives.

Installation

Add @jssg/utils to your codemod project:
package.json

Languages

JavaScript and TypeScript

Locate imports, match file style, and resolve bindings in JavaScript and TypeScript programs.

Java

Check imports and types, resolve visible declarations, and read anonymous class methods.

XML

Find elements, read attributes, and measure indentation.