node-iterator
v1.1.0
Published
A ES6 Generator that traverses the child nodes within the given `Node`
Downloads
10
Maintainers
Readme
node-iterator
A ES6 Generator that traverses the child nodes within the given Node
Installation
$ npm install node-iterator
Example
import NodeIterator from 'node-iterator';
// manual iteration
let node;
for (node of NodeIterator(document.body)) {
console.log(node.nodeName);
}
// cast to an Array
let nodes = [...NodeIterator(document.body)];
console.log(nodes.length);
License
MIT