Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

recursive-iterator

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

recursive-iterator

It iterates through a graph or a tree recursively

  • 3.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
28K
increased by3.08%
Maintainers
1
Weekly downloads
 
Created
Source

Recursive Iterator

NPM version Build status Test coverage

About

It iterates through a graph or a tree recursively.

Versions

  • for support ES5 see 2.x.x versions

Getting started

Quick overview (es6)

let iterator = new RecursiveIterator(
    root /*{Object|Array}*/,
    [bypassMode=0] /*{Number}*/,
    [ignoreCircular=false] /*{Boolean}*/,
    [maxDeep=100] /*{Number}*/
);

let {value, done} = iterator.next();
let {parent, node, key, path, deep} = value;

// parent is parent node
// node is current node
// key is key of node
// path is path to node
// deep is current deep

Example (es6)

let root = {
    object: {
        number: 1
    },
    string: 'foo'
};

for(let {node, path} of new RecursiveIterator(root)) {
    console.log(path.join('.'), node);
}

// object    Object {number: 1}
// object.number    1
// string    foo

Roadmap

Package managers

Bower

bower install recursive-iterator

You could find this module in bower like recursive iterator.

NPM

npm install recursive-iterator

You could find this module in npm like recursive iterator.

Keywords

FAQs

Package last updated on 05 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc