https://github.com/slashhuang/folder-to-tree
print your folder to tree structure
https://github.com/slashhuang/folder-to-tree
json node tree
Last synced: 5 months ago
JSON representation
print your folder to tree structure
- Host: GitHub
- URL: https://github.com/slashhuang/folder-to-tree
- Owner: slashhuang
- Created: 2018-03-22T15:56:09.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-10-21T06:46:48.000Z (over 5 years ago)
- Last Synced: 2025-10-25T05:24:12.813Z (8 months ago)
- Topics: json, node, tree
- Language: TypeScript
- Size: 7.81 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# folder-to-tree
> print your folder to tree structure
## Install
```bash
$ npm i folder-to-tree --save
```
```bash
# command line usage
$ npm i folder-to-tree -g
$ folder2tree
```
a folder to tree npm module built with typescript
## Usage
```js
export interface IFolder2TreeOptions {
isIgnoreHiddenFolderOrFile: boolean; // default to true
ignoreFilePattern: RegExp; // default to /node_modules/
reachLeafNodeCallback: (leafPath: string) => string; // default to render leafNode absolute file path
}
import { folderToTree } from 'folder-to-tree';
const json = folderToTree(dirName, options); // reads folder structure into json
```