walk-dom

0.1.3 • Public • Published

walk

Recursively walk the DOM.

Build Status npm


Install

yarn add walk-dom

Or grab the latest UMD build.

Usage

Pass a root node and a callback. The callback will receive each node as its only argument.

walk(document.body, node => {
  // ...
});

Return false to stop descending a branch.

walk(document.body, node => {
  if (!node.textContent)
    return false;
});

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i walk-dom

Weekly Downloads

0

Version

0.1.3

License

MIT

Last publish

Collaborators

  • camwiegert