Unist-util-find-all-between is a JavaScript utility for the Unist (Universal Syntax Tree) ecosystem, designed to locate and return a collection of child nodes positioned strictly between a specified start and end point within a given parent node. These start and end points can be defined either by their numerical index within the parent's children array or by a Unist node object itself. When node objects are provided, the utility internally relies on `unist-util-find` to locate them and `unist-util-is` for robust node testing. The current stable version is 2.1.0, indicating a mature and relatively stable API. As a specialized utility within the Unist ecosystem, it typically follows a stable release cadence, aligning with broader Unist updates rather than frequent independent feature releases. It offers a precise, range-based selection mechanism, differentiating itself from other `unist-util-find-*` tools by specifically focusing on the 'between' segment, excluding the start and end boundaries. This makes it ideal for operations requiring contextual analysis of AST segments.
npm install unist-util-find-all-betweenVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to find nodes between specified indices or node objects within a Unist tree, showing both basic and advanced usage with TypeScript.
Adjust `start` and `end` parameters or post-process results if you intend to include boundary nodes.
Ensure that `start` and `end` node objects are valid references present as direct or indirect children within the `parent` node.
Refer to the `unist-util-is` documentation for correct `test` parameter formats (string for type, object for properties, function for custom logic).
Ensure the `parent` node is a valid Unist node object that can contain children (e.g., `root`, `paragraph`, `element`).
For ESM, use `import { between } from 'unist-util-find-all-between';`. For CommonJS, use `const between = require('unist-util-find-all-between');`.Ensure that the `start` parameter (index or node) logically precedes the `end` parameter within the `parent` node. The utility expects a valid range.
No dependency data recorded yet.