unist-util-find-between

JSON →
library 1.2.2 ·javascript
verified Jun 4, 2026

unist utility to find nodes between two nodes or indexes in a parent tree. Current stable version is 1.2.2. This is an ESM-only package for Node.js 16+ that provides two functions: findBetween (excludes start/end nodes) and findBetweenIncluded (includes start/end nodes). It is fully typed with TypeScript and works with test functions from unist-util-is. Unlike general tree traversal utilities, this package specifically targets the common need to extract a slice of children between two points, making it ideal for unified plugin developers who need to select a range of sibling nodes.