1.0.10 • Published 3 years ago

@hakansundstrom/get-dir-tree v1.0.10

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

GET-DIR-TREE

Get files and subfolders tree in JSON format of any directory path. This will give you the directory tree from where this was triggered.

Import as default and the response is a Promise with a complete directory tree as JSON data.

Installation

npm i @hakansundstrom/get-dir-tree
var getDirTree = require('get-dir-tree');

/*
 * @argument { boolean } Add true if you want robust data for each file. Otherwise each file just has a true value.
 */
getDirTree(true)
.then(res => {
  // log the response or whatever
})

/*
 * These folders/files are ignored
 * node_modules, .git, .DS_Store, dist, build
 * Add a second argument to getDirTree with regexps in an array to ignore more folders/files
 * eg: [ /myPrivateFolder/, /dontAddme.js/, /iLikePrivate/, /iMakeNoSense.js/ ]
 */

How to use the CLI command

 1. sudo npm i -g @hakansundstrom/get-dir-tree (omit sudo and -g to only locally install)
 2. run 'get-dir-tree --get --robust' from your terminal.
 3. Omit --robust if you only want the dir tree without data on each file.

Maintainers

This project was built and maintained by Håkan Sundström. https://github.com/Sundarenius

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.0

3 years ago