Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 6 days ago
JSON representation
Easily perform a breadth-first-search through DOM elements
- Host: GitHub
- URL: https://github.com/robinfr/dom-bfs
- Owner: Robinfr
- Created: 2018-03-24T15:12:04.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-03-24T15:17:44.000Z (over 6 years ago)
- Last Synced: 2024-10-10T04:07:55.899Z (27 days ago)
- Topics: bfs, breadth-first-search, dom
- Language: TypeScript
- Homepage:
- Size: 43.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.