Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    node-iteratorpublic

    node-iterator

    A ES6 Generator that traverses the child nodes within the given Node

    Sauce Test Status

    Build Status

    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

    install

    npm i node-iterator

    Downloadsweekly downloads

    67

    version

    1.1.0

    license

    MIT

    repository

    githubgithub

    last publish

    collaborators

    • avatar