Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

archy

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

archy

render nested hierarchies `npm ls` style with unicode pipes

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is archy?

The 'archy' npm package is used to generate ASCII trees, which are useful for visualizing hierarchical data structures in a text-based format. It is simple to use and can be integrated into various Node.js applications to display tree structures in a readable manner.

What are archy's main functionalities?

Basic Tree Structure

This feature allows you to create a basic tree structure with a root node and child nodes. The code sample demonstrates how to create a tree with a root labeled 'root', a direct child 'leaf1', and a branch 'branch1' with its own children 'leaf2' and 'leaf3'.

const archy = require('archy');
const tree = archy({
  label: 'root',
  nodes: [
    'leaf1',
    {
      label: 'branch1',
      nodes: [
        'leaf2',
        'leaf3'
      ]
    }
  ]
});
console.log(tree);

Nested Tree Structure

This feature allows you to create more complex, nested tree structures. The code sample demonstrates a tree with multiple levels of branches and leaves, showing how to nest nodes within other nodes.

const archy = require('archy');
const tree = archy({
  label: 'root',
  nodes: [
    {
      label: 'branch1',
      nodes: [
        {
          label: 'sub-branch1',
          nodes: [
            'leaf1',
            'leaf2'
          ]
        },
        'leaf3'
      ]
    },
    'leaf4'
  ]
});
console.log(tree);

Custom Node Labels

This feature allows you to customize the labels of each node in the tree. The code sample demonstrates a tree with a root node labeled 'root' and two branches 'branch1' and 'branch2', each with their own leaves.

const archy = require('archy');
const tree = archy({
  label: 'root',
  nodes: [
    { label: 'branch1', nodes: ['leaf1'] },
    { label: 'branch2', nodes: ['leaf2', 'leaf3'] }
  ]
});
console.log(tree);

Other packages similar to archy

Keywords

FAQs

Package last updated on 14 Sep 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc