Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/robinfr/dom-bfs

Easily perform a breadth-first-search through DOM elements
https://github.com/robinfr/dom-bfs

bfs breadth-first-search dom

Last synced: 5 days ago
JSON representation

Easily perform a breadth-first-search through DOM elements

Awesome Lists containing this project

README

        

# DOM Breadth-first-search

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

## Installation

Run the following command to install:

```bash
npm install dom-bfs --save
```

## Usage

First import:

```javascript
import domBFS from 'dom-bfs';
```

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

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

## TypeScript typings

TypeScript typings are included in the project.