https://github.com/robinfr/dom-dfs
Easily perform a depth-first-search through DOM elements
https://github.com/robinfr/dom-dfs
depth-first-search dfs dom
Last synced: about 1 year ago
JSON representation
Easily perform a depth-first-search through DOM elements
- Host: GitHub
- URL: https://github.com/robinfr/dom-dfs
- Owner: Robinfr
- Created: 2018-03-24T15:11:04.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-03T06:29:25.000Z (about 8 years ago)
- Last Synced: 2025-03-26T10:40:49.265Z (about 1 year ago)
- Topics: depth-first-search, dfs, dom
- Language: TypeScript
- Homepage:
- Size: 81.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DOM Depth-first-search
Allows you to easily perform a depth-first-search (DFS) through DOM elements.
## Installation
Run the following command to install:
```bash
npm install dom-dfs --save
```
## Usage
First import:
```javascript
import domDFS from 'dom-dfs';
```
And then supply the initial DOM element and the condition for when a DOM element should be returned:
```javascript
domDFS(startingElement, element => element.className === 'orange');
```
## TypeScript typings
TypeScript typings are included in the project.