This package, `unist-util-find-after`, provides a lightweight utility for navigating unist (Universal Syntax Tree) trees by locating a node immediately following a specified node or index within a parent. Currently at stable version 5.0.0, it adheres to semantic versioning with major releases introducing breaking changes, and maintains active development within the unified collective. A key differentiator is its seamless integration with other `unist` and `unified` ecosystem tools, simplifying tree manipulation tasks that could otherwise be implemented manually. It is explicitly an ESM-only package, requiring Node.js 16 or newer, and ships with full TypeScript type definitions to ensure robust development.
npm install unist-util-find-afterVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to use `findAfter` to locate a node based on an index or a reference node, with an optional test, within a Unist tree.
Upgrade your Node.js environment to version 16 or newer. For projects that require older Node.js versions, pin `unist-util-find-after` to `<5.0.0`.
Migrate your codebase to use ECMAScript Modules (ESM) `import` syntax. Ensure your project is configured for ESM (e.g., `"type": "module"` in `package.json`).
Update your code to expect and handle `undefined` as a possible return value from `findAfter` when no node is found.
Only use the public `findAfter` export directly from the package's root. Avoid relying on internal or private file paths.
Review the `unist-util-is` changelog for `4.0.0` and update your `unist-util-is`-compatible `Test` functions and their types accordingly. Update `@types/unist` as well if necessary.
Change your import statement to `import { findAfter } from 'unist-util-find-after';` and ensure your project is configured for ESM.Ensure you are using named imports: `import { findAfter } from 'unist-util-find-after';`. Do not attempt `import findAfter from 'unist-util-find-after';` as there is no default export.Ensure the first argument passed to `findAfter` is a `Parent` node type that has a `children` property, such as a `Root` or `Parent` node from `unist-builder` or a parsed AST.
Upgrade your Node.js environment to version 16 or higher. Alternatively, downgrade `unist-util-find-after` to a version compatible with your Node.js environment (e.g., `npm install unist-util-find-after@^4`).