🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

bfsearch

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bfsearch

Breadth-first search a tree

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

bfsearch

Breadth-first search a tree

Usage

const bfsearch = require('bfsearch');

bfsearch(tree, node => {
  // Called with each node
});

Tree

  • should look like this
  • nodes may have a children array of other nodes
  • nodes may have any other properties
{
  id: 1,
  children: [
    {
      id: 2,
      children: [
        {
          id: 3
        }
      ]
    }
  ]
}

Keywords

tree

FAQs

Package last updated on 26 Nov 2019

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