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

treescape

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

treescape

A simple JavaScript module for creating and printing binary trees in ASCII format.

latest
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

treescape

A simple JavaScript module for creating and printing binary trees in ASCII format.

Installation

npm install treescape

Usage

const { convertToTree, printTree } = require("treescape");

const tree = convertToTree([1, 2, 3, null, 4, 5, 6]);
printTree(tree);

Output:

	  __1__
         /     \
        2       3
         \     / \
	  4   5   6

API

convertToTree(array)

Creates a binary tree from a level-order array (use null for empty nodes).

printTree(treeNode)

Prints the tree in ASCII format to the console.

License

MIT

Keywords

binary tree

FAQs

Package last updated on 11 Aug 2025

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