chvolkmann / fs-tree

Prints a directory structure similar to the Unix tree command

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fs-tree

A utility for printing a directory tree, similar to the Unix tree command.

Example

❯ tree .
/fs-tree/
├── .gitignore
├── README.md
├── bin/
├── bun.lockb
├── dist/
├── package.json
├── src/
└── tsconfig.json
❯ tree . 2
/fs-tree/
├── .gitignore
├── README.md
├── bun.lockb
├── package.json
├── src/
│   ├── constants.ts
│   ├── fsnode.ts
│   ├── index.ts
│   ├── main.ts
│   ├── styles.ts
│   ├── tree.ts
│   ├── tree_formatter.ts
│   └── utils.ts
└── tsconfig.json

Development

Using bun

npm i -g bun # if not yet installed

# install dependencies
bun install

# run the CLI
bun dev

bun format

Building

# build:lib - compile TS to JS, bundle npm library to dist/main.js
# build:cli - output a self-contained executable to bin/tree
bun compile

# delete bin/ and dist/
bun clean

Publishing

npm whoami
npm adduser # if not yet authorized

# bump patch version and upload to npm
bun release

About

Prints a directory structure similar to the Unix tree command


Languages

Language:TypeScript 100.0%