New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

deep-print

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deep-print

Displays a tree structure in the console, supporting both binary trees and trees with an arbitrary number of children.

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-50%
Maintainers
0
Weekly downloads
 
Created
Source

deep-print

Displays a tree structure in the console, supporting both binary trees and trees with an arbitrary number of children.

Installation

To install the package, use npm:

pnpm add deep-print

yarn install deep-print

npm install deep-print

Usage

// Deep Print

import React from "react";
import { dp } from "deep-print";

const str = 'start' + dp('', [
   (tab) => 'line 1',
   (tab) => 'line 2' + dp(tab, [
      (tab) => 'line 2.1',
      (tab) => 'line 2.2',
   ])
   (tab) => 'line 3',
]);

console.log(str);
// start
// ├── line 1
// │
// ├── line 2
// │   ├── line 2.1
// │   └── line 2.2
// └── line 3
// Deep Print Binary

import React from "react";
import { dpd } from "deep-print";

const str =
  "Node" +
  dpd("", [
    (tab) => "left" + printBinary(tab, [() => "left 1", () => "right 1"]),
    (tab) => "right" + printBinary(tab, [() => "left 2", () => "right 2"]),
  ]);

console.log(str);
// Node
// ← left
//   ← left 1
//   → right 1
// → right
//   ← left 2
//   → right 2

tsup

Bundle your TypeScript library with no config, powered by esbuild.

https://tsup.egoist.dev/

How to use this

  1. install dependencies
# pnpm
$ pnpm install

# yarn
$ yarn install

# npm
$ npm install
  1. Add your code to src
  2. Add export statement to src/index.ts
  3. Test build command to build src. Once the command works properly, you will see dist folder.
# pnpm
$ pnpm run build

# yarn
$ yarn run build

# npm
$ npm run build
  1. Publish your package
$ npm publish

test package

https://www.npmjs.com/package/deep-print

FAQs

Package last updated on 23 Sep 2024

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