ast-monkey-util is a JavaScript utility library that provides a set of helper functions specifically designed for manipulating and navigating Abstract Syntax Trees (ASTs). It is currently at version 3.1.3 and is actively maintained within the Codsen monorepo, indicated by recent copyright updates and ongoing development. The library focuses on granular utilities for path manipulation within nested object structures that represent ASTs, offering functions to determine the next, previous, or parent path, and to identify a parent key. This makes it particularly useful for tasks requiring precise positional awareness without needing full AST traversal or transformation. A key differentiator is its pure ESM distribution, aligning with modern JavaScript module standards, which necessitates a Node.js environment of `v14.18.0` or higher for current versions.
npm install ast-monkey-utilVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `ast-monkey-util` functions to navigate and query AST paths, including moving to next/previous siblings, ascending to a parent path, and identifying a parent key.
Migrate your project to use ES modules (`import`) or install an older CommonJS-compatible version like `ast-monkey-util@1.4.0`.
Ensure all AST path inputs conform to the '`root.key.index.key.index`' string format. Always pass valid non-empty strings.
Upgrade your Node.js environment to version 14.18.0 or newer to ensure full compatibility and access to ESM features.
Convert your module to ES modules by using `import { func } from 'ast-monkey-util'` and ensuring your `package.json` specifies `"type": "module"`, or install `ast-monkey-util@1.4.0` for CommonJS compatibility.Verify that all path arguments passed to `ast-monkey-util` functions are valid non-empty strings representing AST paths.
No dependency data recorded yet.