1.0.1 • Published 6 years ago

dom-bfs v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

DOM Breadth-first-search

Allows you to easily perform a breadth-first-search (BFS) through DOM elements.

Installation

Run the following command to install:

npm install dom-bfs --save

Usage

First import:

import domBFS from 'dom-bfs';

And then supply the initial DOM element and the condition for when a DOM element should be returned:

domBFS(startingElement, element => element.className === 'orange');

TypeScript typings

TypeScript typings are included in the project.