0.1.0 • Published 10 years ago

treee v0.1.0

Weekly downloads
2
License
mit
Repository
github
Last release
10 years ago

treee

walk through file system and output a tree

install

npm install treee

api

treee.get(dirpath, options)

parameters

  • dirpath {Stirng}: the dir you want to get file system tree from
  • options {Object}: options including:
    • nodeName {String}, default:name : the key you want to get file node name from
    • skipDotDir {Boolean}, default:false : ignore dot prefix dir or not (e.g, .gitignore)
    • showEmptyChildren {Boolean}, default:false : show empty children array even if the node doesn't contain any children
    • showRelative {Boolean}, default:false : add a path attribute to every node, showing the relative path from the dirpath
    • absolutePath {Boolean}, default:false : show absolute path in every node

examples

var treee= require('treee');
treee.get(<dirpath>, { nodeName: 'label' })
	 .then(function(tree){
	 	// do whatever you want to the tree
	 	/* tree=
			{	
			    label: "folder",
			    type: "dir",
			    children: [
			        {
			            label: "test1",
			            type: "file"
			        },
			        {
			            label: "test2",
			            type: "file",
			        }
			    ]
			}
	 	*/
	 })
0.1.0

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago