How to use the treeify.asTree function in treeify

To help you get started, we’ve selected a few treeify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tes / bosco / src / RunListHelper.js View on Github external
resolveDependencies(filteredRepos, [], function (err, repoList) {
    var runList = _.chain(repoList)
      .filter(boscoOptionFilter('deps-only', notCurrentService))
      .filter(boscoOptionFilter('docker-only', isType('remote')))
      .map(getConfig)
      .filter(isInfraOnly)
      .filter(exclude)
      .sortBy(getOrder)
      .value();

    if (displayOnly) {
      _.chain(repos)
        .map(_.curry(createTree)(tree, []))
        .value();
      /* eslint-disable no-console */
      console.log(treeify.asTree(tree));
      /* eslint-enable no-console */
      next();
    } else {
      next(null, runList);
    }
  });
}
github node-opcua / node-opcua / packages / node-opcua-samples / bin / simple_client_ts.ts View on Github external
const dataValue = await the_session.readVariableValue(server_NamespaceArray_Id);

    console.log(" --- NAMESPACE ARRAY ---");
    const namespaceArray = dataValue.value.value;
    for (const namespace of namespaceArray) {
        console.log(" Namespace ", namespace.index, "  : ", namespace);
    }
    console.log(" -----------------------");

    // -----------------------------------------------------------------------------------------------------------
    //   enumerate all EVENT TYPES
    // -----------------------------------------------------------------------------------------------------------
    const result = getAllEventTypes(the_session);
    console.log(chalk.cyan("---------------------------------------------------- All Event Types "));
    console.log(treeify.asTree(result, true));
    console.log(" -----------------------");

    // -----------------------------------------------------------------------------------------------------------
    //   Node Crawling
    // -----------------------------------------------------------------------------------------------------------
    let t1: number;
    let t2: number;

    function print_stat() {
        t2 = Date.now();
        const str = util.format("R= %d W= %d T=%d t= %d",
            client.bytesRead, client.bytesWritten, client.transactionsPerformed, (t2 - t1));
        console.log(chalk.yellow.bold(str));
    }

    if (doCrawling) {
github ConsenSys / surya / src / ftrace.js View on Github external
if(functionCallObject.contract.substring(0,8) !== '#address') {
            constructCallTree(functionCallObject.contract, functionCallName, parentObject[keyString])
          }
        } else {
          parentObject[keyString] = Object.keys(functionCallsTree[functionCallObject.contract][functionCallName]).length === 0 ?
                                    {} :
                                    '..[Repeated Ref]..'.red
        }
      }
    })
  }

  // Call with seed
  constructCallTree(contractToTraverse, functionToTraverse, callTree[seedKeyString])

  return treeify.asTree(callTree, true)
}
github ORESoftware / npm-link-up / lib / commands / ls / index.ts View on Github external
searchDir(searchRoot, treeObj[key], err => {

  if (err) {
    throw err;
  }

  cleanTree(treeObj);

  const treeString = treeify.asTree(treeObj, true);
  const formattedStr = String(treeString).split('\n').map(function (line) {
    return '\t' + line;
  });

  console.log(chalk.white(formattedStr.join('\n')));
  process.exit(0);

});
github node-opcua / node-opcua / packages / node-opcua-samples / bin / simple_client_ts.ts View on Github external
console.log(" connecting to ", chalk.cyan.bold(endpointUrl));
    console.log("    strategy", client.connectionStrategy);

    try {
        await client.connect(endpointUrl);
    } catch (err) {
        console.log(chalk.red(" Cannot connect to ") + endpointUrl);
        console.log(" Error = ", err.message);
        return;
    }

    const endpoints = await client.getEndpoints();

    if (argv.debug) {
        fs.writeFileSync("tmp/endpoints.log", JSON.stringify(endpoints, null, " "));
        console.log(treeify.asTree(endpoints, true));
    }

    const table = new Table();

    let serverCertificate: Certificate | undefined;

    let i = 0;
    for (const endpoint of endpoints) {
        table.cell("endpoint", endpoint.endpointUrl + "");
        table.cell("Application URI", endpoint.server.applicationUri);
        table.cell("Product URI", endpoint.server.productUri);
        table.cell("Application Name", endpoint.server.applicationName.text);
        table.cell("Security Mode", MessageSecurityMode[endpoint.securityMode].toString());
        table.cell("securityPolicyUri", endpoint.securityPolicyUri);
        table.cell("Type", ApplicationType[endpoint.server.applicationType]);
        table.cell("certificate", "..." /*endpoint.serverCertificate*/);
github mxmul / webpack-why / src / index.js View on Github external
stats.assets.forEach(asset => {
                const entries = getEntries(stats.modules, asset.chunks);
                const tree = buildDependencyTree(
                    stats.modules,
                    entries,
                    module,
                );

                if (Object.keys(tree[module.name]).length > 0) {
                    console.log(chalk.bold(`Hash: ${stats.hash}`));
                    console.log(chalk.bold.green(asset.name));
                    console.log(treeify.asTree(tree, true));
                }
            });
        }
github quicktype / autotune / src / cli / index.ts View on Github external
async function cmdShowTrees(appKey: string): Promise {
    const outcomes = await getOutcomesForAppKeyOrFilename(appKey);

    for (const experimentKey of Object.getOwnPropertyNames(outcomes)) {
        console.log(bold(magenta(experimentKey)));
        console.log(treeify.asTree(makePrintTree(outcomes[experimentKey]), true));
    }
}
github electrode-io / electrode-native / ern-orchestrator / src / composite.ts View on Github external
export function logDependenciesTree(
  parser: YarnLockParser,
  deps: PackagePath[],
  logLevel: 'debug' | 'error'
) {
  for (const dep of deps) {
    const depTree = parser.buildDependencyTree(dep)
    logLevel === 'debug'
      ? log.debug(treeify.asTree(depTree, true, true))
      : log.error(treeify.asTree(depTree, true, true))
  }
}
github davglass / license-checker / lib / index.js View on Github external
exports.asTree = function(sorted) {
    return treeify.asTree(sorted, true);
};
github zoubin / tree-directory / index.js View on Github external
.then(function (files) {
      return treeify.asTree(obj(files))
    })
}

treeify

converts a JS object into a nice and readable tree structure for the console

MIT
Latest version published 6 years ago

Package Health Score

55 / 100
Full package analysis

Popular treeify functions