Socket
Book a DemoInstallSign in
Socket

gntr

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gntr

Tree traversal with ES6 generators

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

gntr

Tree traversal using ES6 generators, influenced by pep-0255

Currently you must use the --harmony-generators flag when running node 0.11.x to get access to generators.

Installation:

$ npm install gntr

Example:

var gntr = require('gntr');
var root = gntr.tree(['A','B','C','D','E','F','G','H','I']);
var results = [];

for (let value of gntr.preorder(root)) {
    results.push(value);
}

console.log(results);
// Would log  ['F', 'B', 'A', 'D', 'C', 'E', 'G', 'I', 'H']

Keywords

ES6

FAQs

Package last updated on 22 Nov 2014

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