unist-util-visit is a utility for working with Unist syntax trees, letting you walk the tree and run a visitor function on matching nodes. It provides helpers to continue traversal, skip child traversal, and exit early, which is useful for tasks like processing or inspecting nodes in a tree structure.
Project status
- The source appears actively maintained, with the most recent upstream push and documented updates occurring on 2026-01-22 (v5.1.0), which is within about 4.5 months of today (2026-06-09).
- Update cadence is somewhat irregular: there was a long gap after 5.0.0 (2023-07-07) until the next update in 2026-01-22, but the latest update is recent.
AI summary generated
Recent updates
5.1.0
Release 5.1.0 focuses on TypeScript type declaration improvements, including switching JSDoc to use `@import`s, adding declaration maps, and improving type support for readonly array checks. The runtime library code does not show functional changes in the provided diff, but the repo build and CI toolchain were updated.
Features5.0.0
Release 5.0.0 is a major update that modernizes the package for ESM tooling and TypeScript, including updating the public export setup and tightening Node.js support. It also changes the `visit` callback’s `index` and `parent` values to use `undefined` instead of `null`, and contains a TypeScript performance fix around `InclusiveDescendant`.
Breaking4.1.2
Release 4.1.2 is described as documentation and code-style/refactor work, plus a tsconfig update. However, the actual diff shows a larger restructure: the runtime implementation and most type definitions were moved into a new lib/index.js with new/reworked declaration entrypoints, while the root index.js became a re-export layer.
4.1.1
Release 4.1.1 is a patch update focused on fixing TypeScript Node16 ESM typing and improving documentation. The code diff mainly adjusts type import paths for Node16 ESM compatibility and updates test tooling, with a runtime dependency bump to `unist-util-visit-parents`.
4.1.0
Release 4.1.0 focuses on improving the TypeScript typing for the `parent` argument passed to the `visit` visitor callback. The code diff shows this is implemented via a new internal typing module (`complex-types.d.ts`) and updated overloads for `visit`, with additional development dependency bumps.
4.0.0
Release 4.0.0 primarily changes the TypeScript types for `visit` so that the `visitor` node type is inferred based on the provided `tree`. The implementation appears largely the same at runtime, but the project also bumps `unist-util-visit-parents` to a new major version and updates various dev tooling and TS compiler settings.
Breaking3.1.0
Release 3.1.0 is described as adding a `VisitorResult` type. The actual diff shows type definition and JSDoc signature changes around `visit()` that may affect TypeScript consumers, beyond merely introducing the `VisitorResult` type.
Features3.0.1
Release 3.0.1 updates documentation to demonstrate ESM usage (import syntax and arrow function) in the README example. The only functional change in the diff is a tooling dependency bump in package.json.
3.0.0
Version 3.0.0 migrates the package to ESM and replaces the old TypeScript declaration files with JSDoc-driven types. The runtime entry point changes from a CommonJS-exported function to named ESM exports for `visit` and the traversal control constants.
Breaking2.0.3
Release 2.0.3 is a small TypeScript typing-focused update. The release notes only mention a fix to the `parent` type, and the code diff shows a corresponding change in the exported TypeScript definitions.
Breaking