recursive-iterator

3.3.0last stable release 8 years ago
Complexity Score
Low
Open Issues
3
Dependent Projects
43
Weekly Downloadsglobal
30,375

License

  • MIT
    • Yesattribution
    • Permissivelinking
    • Permissivedistribution
    • Permissivemodification
    • Nopatent grant
    • Yesprivate use
    • Permissivesublicensing
    • Notrademark grant

Downloads

Readme

Recursive Iterator

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

  • Syntax
    • ES6
    • ES5
  • API
    • Options
    • Methods & Callbacks
  • Cookbook (es6)
    • Iterator (not recursive)
    • DomIterator
    • Deep copy / Deep clone
    • To Query String
    • To Form Data
    • Uninformed search algorithms

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.

Dependencies

No runtime dependency information found for this package.

CVE IssuesActive
0
Scorecards Score
1.70
Test Coverage
No Data
Follows Semver
Yes
Github Stars
90
Dependenciestotal
9
DependenciesOutdated
7
DependenciesDeprecated
2
Threat Modelling
No
Repo Audits
No

Learn how to distribute recursive-iterator in your own private NPM registry

npm config set registry  https://npm.cloudsmith.com/owner/repo
Processing...
Done
npm install recursive-iterator
Processing...
Done

9 Releases

NPM on Cloudsmith

Getting started with NPM on Cloudsmith is fast and easy.