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
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);
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);
tsup
Bundle your TypeScript library with no config, powered by esbuild.
https://tsup.egoist.dev/
How to use this
- install dependencies
# pnpm
$ pnpm install
# yarn
$ yarn install
# npm
$ npm install
- Add your code to
src
- Add export statement to
src/index.ts
- 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
- Publish your package
$ npm publish
test package
https://www.npmjs.com/package/deep-print