New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

traverse-all

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

traverse-all

methods to traverse every thing

latest
Source
npmnpm
Version
1.0.0-beta-11
Version published
Maintainers
1
Created
Source

traverse-all 👌

Documentation Maintenance License: ISC

methods to traverse every thing!

more language:

zh-CN

Install

npm install traverse-all

Usage

base usage

import module

const Traverse = require("traverse-all");

Traverse.traverse_recursive(nodes, options);

import defined method from module

const { traverse_recursive } = require("traverse-all");

traverse_recursive(nodes, options);

Methods Usage

traverse_recursive(nodes,options)

  • nodesArray root nodes
  • optionsObject traverse options which includes:
    • predicate:Function required
    • nodeHandle:Function required
    • exclude: Function
    • ignore: Function
  • return Promise<any>

predicate(node):{done:Boolean,iterators:Array}

  • node:current node
  • done:whether current node finish traversing
  • iterators:node array to traverse of current node

nodeHandle(node,params,options,result):node

  • node:current node
  • params:node traverse params
  • options:traverse options
  • result:result which can be trans to next node
  • return:node NOTE:even do nothing,you must return the node,ex:node=>node

params

  • path:Array<node>node path
  • isLeaf:Boolean
  • isFirst:Booleanis first node of current traverse level
  • isLast:Booleanis last node of current traverse level

Author

👤 dzg

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2019 dzg.

This project is ISC licensed.

Keywords

js

FAQs

Package last updated on 18 Jul 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