dir-parser
Advanced tools
+1
-246
@@ -1,247 +0,2 @@ | ||
| dir-parser ( Directorys: 106, Files: 174 ) | ||
| ├─ .git | ||
| │ ├─ hooks | ||
| │ │ ├─ applypatch-msg.sample | ||
| │ │ ├─ commit-msg.sample | ||
| │ │ ├─ post-update.sample | ||
| │ │ ├─ pre-applypatch.sample | ||
| │ │ ├─ pre-commit.sample | ||
| │ │ ├─ pre-push.sample | ||
| │ │ ├─ pre-rebase.sample | ||
| │ │ ├─ prepare-commit-msg.sample | ||
| │ │ └─ update.sample | ||
| │ ├─ info | ||
| │ │ └─ exclude | ||
| │ ├─ logs | ||
| │ │ ├─ refs | ||
| │ │ │ ├─ heads | ||
| │ │ │ │ └─ master | ||
| │ │ │ └─ remotes | ||
| │ │ │ └─ origin | ||
| │ │ │ └─ master | ||
| │ │ └─ HEAD | ||
| │ ├─ objects | ||
| │ │ ├─ 01 | ||
| │ │ │ └─ 87173417126fe7f76a272b3e2bf6548da46bbe | ||
| │ │ ├─ 05 | ||
| │ │ │ └─ 11f8b1de2d2eba5069c50821009767117a2e3a | ||
| │ │ ├─ 06 | ||
| │ │ │ └─ 847014647f53a6f6befaec571ac62c6e81c120 | ||
| │ │ ├─ 0d | ||
| │ │ │ └─ 8925bbcd56971af2215b4835ae5b8859e19881 | ||
| │ │ ├─ 10 | ||
| │ │ │ └─ f997ab104594695189c3fca8fa6c65ae9ccdd6 | ||
| │ │ ├─ 11 | ||
| │ │ │ └─ d6036f3d73c063d3c7fae5f73aef96fce04ad5 | ||
| │ │ ├─ 17 | ||
| │ │ │ └─ a148394651b464418fa6c1d334ecfa09143b97 | ||
| │ │ ├─ 18 | ||
| │ │ │ └─ 152e6b59db66eb654cc72c901dd76beace7ac2 | ||
| │ │ ├─ 1a | ||
| │ │ │ └─ 1aa60c646e2ea0224547c901f713dcd264dc39 | ||
| │ │ ├─ 1c | ||
| │ │ │ └─ ca6259a53f14dd24377c188aa4cac6b259e6aa | ||
| │ │ ├─ 1f | ||
| │ │ │ └─ 06502163c6c88276890ddf5aae5dbaaec1f4a0 | ||
| │ │ ├─ 24 | ||
| │ │ │ └─ 4d9db209e126b42c047a8fcbc6b3125c7d8a8a | ||
| │ │ ├─ 25 | ||
| │ │ │ └─ b1fd76c00757bc1a3f2c7e21a66fad0ea9f4dc | ||
| │ │ ├─ 2b | ||
| │ │ │ └─ 21133d040492e880bcda616ea16c8c3c8ac2d3 | ||
| │ │ ├─ 2e | ||
| │ │ │ └─ 94dd6fff790b981e8d40c326e82707942b25cd | ||
| │ │ ├─ 30 | ||
| │ │ │ └─ 2ad0d1f3794d6e315651a1d3a7312fd59cb4fa | ||
| │ │ ├─ 31 | ||
| │ │ │ └─ 2b056dea3f50a8a2f29745efa2e6269690e794 | ||
| │ │ ├─ 32 | ||
| │ │ │ └─ 5e1656484f4c56579a2f908910ea962d3c9b73 | ||
| │ │ ├─ 36 | ||
| │ │ │ ├─ 828eb4d70b4ccb409072f1a1b4c0eaaf102d2e | ||
| │ │ │ └─ ca58f29a44d68bebce95b7f06a2c2f1faa4026 | ||
| │ │ ├─ 38 | ||
| │ │ │ └─ 093cbf6b2ce5cf6d3ca3947ab8943437bf1ee0 | ||
| │ │ ├─ 3b | ||
| │ │ │ ├─ 0cc80944d38e6e1ad09ab96c415b02038750ac | ||
| │ │ │ └─ 54cac1e39746ee7b32c073ba3ea00cbc56fa02 | ||
| │ │ ├─ 44 | ||
| │ │ │ ├─ 49dd30d7e7ad2437ab09a17e630e4c0e7fe04a | ||
| │ │ │ └─ cab7a95d4a89309b284e91e690096012a2cfc5 | ||
| │ │ ├─ 46 | ||
| │ │ │ ├─ 08b3947f0a70bee0587e1d100b2fb4e0b30ce4 | ||
| │ │ │ └─ 1fe717b196d0986cdacc5069c85f01c0bdc2fd | ||
| │ │ ├─ 4b | ||
| │ │ │ └─ 568d9ae37345665d929d12810ecedfa0073fc5 | ||
| │ │ ├─ 50 | ||
| │ │ │ ├─ 4afef81fbadc8c0a072e1ac93f1376bca7f4a9 | ||
| │ │ │ └─ f4d280814b365c8ee857938c37e565cdc3b43f | ||
| │ │ ├─ 51 | ||
| │ │ │ └─ 4cfb1f6db9cc80292289871d24eba5b1e0b503 | ||
| │ │ ├─ 54 | ||
| │ │ │ └─ 902c0a8c92a0628a41b7c5f46fb15364061f04 | ||
| │ │ ├─ 58 | ||
| │ │ │ └─ 3f484d6dac6a322f7fcd0b0ea4ec415326f6aa | ||
| │ │ ├─ 59 | ||
| │ │ │ └─ e83f2a0a166bdf1a12593d17d3a1ec79ca8401 | ||
| │ │ ├─ 5f | ||
| │ │ │ ├─ 74758ece6c83908701b9254a7428b0a59dce98 | ||
| │ │ │ ├─ 8a5741623a139b27924ebc32d39b83bec26508 | ||
| │ │ │ └─ a465658d4256388768d33606316f9302d3ed10 | ||
| │ │ ├─ 60 | ||
| │ │ │ └─ 1402f49dfb65ce3d957b3c650e8e6e1eb017fc | ||
| │ │ ├─ 6a | ||
| │ │ │ └─ 2feb9f245f6b7dbb6bdf8df5b8d8fab7062d38 | ||
| │ │ ├─ 6b | ||
| │ │ │ ├─ 732111a9563e30835084159c1c76e817ef6ca9 | ||
| │ │ │ └─ efe28b9cb97847a1de15d46b8866a10e89570c | ||
| │ │ ├─ 6d | ||
| │ │ │ └─ 4271abc950cbecf32c75b95096212bf955bfb0 | ||
| │ │ ├─ 70 | ||
| │ │ │ └─ d65139895eae205b96842213207e35f8713abf | ||
| │ │ ├─ 71 | ||
| │ │ │ └─ 27530072dbe131527a261cf7dbe45b0cede683 | ||
| │ │ ├─ 72 | ||
| │ │ │ ├─ 068c39f6c6b29665351c8dfe75010e6da32703 | ||
| │ │ │ └─ 5e0950d6b6d1cc710e8f25ba1e2952bdcf10db | ||
| │ │ ├─ 78 | ||
| │ │ │ └─ 08238b91440821d65f1fa7df60df682c179d3a | ||
| │ │ ├─ 79 | ||
| │ │ │ └─ 3d71a3eca106c9fff0306f3504446d0f7e3680 | ||
| │ │ ├─ 7f | ||
| │ │ │ └─ a53fd16954a6e6d29e314629e79d6c10971015 | ||
| │ │ ├─ 85 | ||
| │ │ │ └─ b6d497ef9611cf0f1b0f40085c6847675c7b72 | ||
| │ │ ├─ 87 | ||
| │ │ │ └─ ffd37d3f74c37d34cd01acef408f6502f970e1 | ||
| │ │ ├─ 88 | ||
| │ │ │ └─ 7ec30dcc88a109cb02cca8a56072cdbc982225 | ||
| │ │ ├─ 89 | ||
| │ │ │ └─ 280b68af62dbbba38894945ea07c41b6c7ded9 | ||
| │ │ ├─ 8b | ||
| │ │ │ └─ de047ee13c76db4ba2533067becf805f90a0f8 | ||
| │ │ ├─ 8e | ||
| │ │ │ └─ b0740a721c6746a31baf3ee4c9e452d40085f3 | ||
| │ │ ├─ 8f | ||
| │ │ │ └─ 1cef56be4ebd541b763a86c7be7a80d99b7a82 | ||
| │ │ ├─ 90 | ||
| │ │ │ └─ ee1b2463f0439b56bbc841236ce433b8fdccca | ||
| │ │ ├─ 93 | ||
| │ │ │ └─ 2594f11d994819ceaa053dbfbcc62e2d06818c | ||
| │ │ ├─ 94 | ||
| │ │ │ └─ b5101468f861fc88c1334c0355eef5ac765992 | ||
| │ │ ├─ 96 | ||
| │ │ │ ├─ aa30f63edd206eaa01023f1cb1dbdf30fc8407 | ||
| │ │ │ └─ c4394c19ec0f5b4626f1302ad1ad0187cd62f7 | ||
| │ │ ├─ a2 | ||
| │ │ │ ├─ 7ec1b88104203abc32822e13d891009975027e | ||
| │ │ │ ├─ a1547382219fb9a94681def386bbe343aacfa4 | ||
| │ │ │ └─ c91b5d42894fb7f388a484f466dfc338b6d3c4 | ||
| │ │ ├─ a4 | ||
| │ │ │ ├─ 207c156415715295aec57dc7e5e5831d239a87 | ||
| │ │ │ └─ 364b0d4ad4c1b80fb6dc0f1de3303078169c8a | ||
| │ │ ├─ a6 | ||
| │ │ │ ├─ 4a13076d95224537d555f9895c78c10f2375cb | ||
| │ │ │ └─ 7611f82dd793143b42b8811c48fb2eea730ba1 | ||
| │ │ ├─ ae | ||
| │ │ │ └─ 54e3764bd7619ab598171666b37c8c99fd9d42 | ||
| │ │ ├─ b3 | ||
| │ │ │ ├─ 6d6f4f19269e1e668a907ca6144d10e34bca40 | ||
| │ │ │ ├─ 9504fe7870c6ed51acfbc3469e0d256e90d17b | ||
| │ │ │ ├─ e02978a6bb23e491df159fc1ce7d1c20749b29 | ||
| │ │ │ └─ e914601ab0d8fa40c5a40fc079667c09ebee16 | ||
| │ │ ├─ ba | ||
| │ │ │ ├─ 79193f3b315d08d178bec0d6d50d0f51143a5c | ||
| │ │ │ └─ bb0611cec70d5823203bf27d349877792d2a5f | ||
| │ │ ├─ bc | ||
| │ │ │ └─ 6f25677b1dac2864a6c2ba497e0c6d988ae5a1 | ||
| │ │ ├─ bf | ||
| │ │ │ └─ 039c90af0fdc7d24098c7b8b10ea4cd8c89128 | ||
| │ │ ├─ c4 | ||
| │ │ │ └─ 82fc0b9f97fe92a534166f03f4402409b95921 | ||
| │ │ ├─ c5 | ||
| │ │ │ └─ bee1e6593fe23896fad1d57b8ed89492b6fc6d | ||
| │ │ ├─ c6 | ||
| │ │ │ └─ 13b4aada9eb3ee62f2cfb51b38f7db049989f0 | ||
| │ │ ├─ c8 | ||
| │ │ │ └─ 2f9a4f62d0bc3faae3e45966691d4058c916ba | ||
| │ │ ├─ cf | ||
| │ │ │ └─ 5ab7a9b867aee53a4d16edf6275a2df6ab9e4c | ||
| │ │ ├─ d3 | ||
| │ │ │ └─ 0963454815b808528b0db375da01f6a5717040 | ||
| │ │ ├─ d5 | ||
| │ │ │ └─ 1245871b298a0476136b2eb08c60f9410879c9 | ||
| │ │ ├─ d9 | ||
| │ │ │ └─ be0aa18ee63c6018a7322a8c3bed7b7a54350c | ||
| │ │ ├─ da | ||
| │ │ │ └─ a76e5969f9968ccaa4b8f87c37087919e971ae | ||
| │ │ ├─ e0 | ||
| │ │ │ └─ aee19172a6876d86e0bbff741228fb5aefae6b | ||
| │ │ ├─ e5 | ||
| │ │ │ └─ 3766066f2598d8ae694276b8e7710129e206da | ||
| │ │ ├─ e6 | ||
| │ │ │ └─ 9de29bb2d1d6434b8b29ae775ad8c2e48c5391 | ||
| │ │ ├─ e8 | ||
| │ │ │ └─ a63ee535e5033c063dcecaeacffc529e7445e5 | ||
| │ │ ├─ eb | ||
| │ │ │ └─ 8a9b6b29c10e97855d853db7e4cbdfa021bda0 | ||
| │ │ ├─ ee | ||
| │ │ │ └─ 4f5b1dc242ff27f6515ce7efef7348f8e15d74 | ||
| │ │ ├─ f4 | ||
| │ │ │ └─ 09fad08c57a4171790c28a9d4a709676c69744 | ||
| │ │ ├─ f5 | ||
| │ │ │ ├─ c01d0a5767c1aa9c5454db8f985ae362ab9ddb | ||
| │ │ │ └─ d25b7fb39289dab856de1d98553552dd3b39c2 | ||
| │ │ ├─ f7 | ||
| │ │ │ └─ 7ddf7bcc35fc8f3c7f7aaedbe105170c44f76a | ||
| │ │ ├─ f9 | ||
| │ │ │ └─ 33be10a1976f9242b8d510aa15628b6ce5446c | ||
| │ │ ├─ fb | ||
| │ │ │ ├─ 431864c567d5ea9b266e0027e06c0bf6118dca | ||
| │ │ │ ├─ 57d442aa96504825de130c9710ce18d5346cc1 | ||
| │ │ │ └─ df2ca164bfc06013d101e61724083073ec6cc6 | ||
| │ │ ├─ fc | ||
| │ │ │ └─ 9234de7abd74d35882c1fc1aa750b67d87ec24 | ||
| │ │ ├─ fd | ||
| │ │ │ └─ 4f69c99491c3bee58a7459280cf9fa0c2e61a9 | ||
| │ │ ├─ fe | ||
| │ │ │ └─ e87d0e3bce914d3a594f62888fe77dbbfebb96 | ||
| │ │ ├─ info | ||
| │ │ └─ pack | ||
| │ ├─ rebase-apply | ||
| │ │ ├─ 0001 | ||
| │ │ ├─ abort-safety | ||
| │ │ ├─ apply-opt | ||
| │ │ ├─ author-script | ||
| │ │ ├─ final-commit | ||
| │ │ ├─ head-name | ||
| │ │ ├─ keep | ||
| │ │ ├─ last | ||
| │ │ ├─ messageid | ||
| │ │ ├─ next | ||
| │ │ ├─ onto | ||
| │ │ ├─ orig-head | ||
| │ │ ├─ original-commit | ||
| │ │ ├─ patch | ||
| │ │ ├─ patch-merge-index | ||
| │ │ ├─ quiet | ||
| │ │ ├─ rebasing | ||
| │ │ ├─ scissors | ||
| │ │ ├─ sign | ||
| │ │ ├─ threeway | ||
| │ │ └─ utf8 | ||
| │ ├─ refs | ||
| │ │ ├─ heads | ||
| │ │ │ └─ master | ||
| │ │ ├─ remotes | ||
| │ │ │ └─ origin | ||
| │ │ │ └─ master | ||
| │ │ └─ tags | ||
| │ ├─ COMMIT_EDITMSG | ||
| │ ├─ config | ||
| │ ├─ description | ||
| │ ├─ FETCH_HEAD | ||
| │ ├─ HEAD | ||
| │ ├─ index | ||
| │ └─ ORIG_HEAD | ||
| dir-parser ( Directorys: 7, Files: 28 ) | ||
| ├─ bin | ||
@@ -248,0 +3,0 @@ │ └─ parser.js |
+2
-2
@@ -28,4 +28,4 @@ #!/usr/bin/env node | ||
| * @param dirPath string | ||
| * @param deep deep = 1 | ||
| * @param prev prev = '' | ||
| * @param deep deep = 1 | ||
| * @param prev prev = '' | ||
| */ | ||
@@ -32,0 +32,0 @@ function parseDir(dirPath, deep = 1, prev = '') { |
+1
-1
| { | ||
| "name": "dir-parser", | ||
| "version": "1.0.6", | ||
| "version": "1.0.7", | ||
| "description": "Parse a directory and generate it's structure tree.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+113
-26
@@ -7,4 +7,5 @@ # Dir Parser | ||
| ### Demo | ||
| ### Demo Image | ||
|  | ||
| ### Install dir-parser | ||
@@ -32,40 +33,54 @@ ``` | ||
| ``` | ||
| $ cd your/demo/dir | ||
| $ parse | ||
| # It will generate a text file: 'dir-info.txt'; | ||
| # in terminal log: | ||
| dir | ||
| ├─ subdir | ||
| │ └─ file1.txt | ||
| ├─ subdir2 | ||
| │ ├─ dem1 | ||
| │ │ └─ test1.txt | ||
| │ └─ dem2 | ||
| └─ README.md | ||
| $ cd your/demo/app | ||
| $ parse # Terminal log: | ||
| app ( Directorys: 7, Files: 9 ) | ||
| ├─ bin | ||
| │ └─ www | ||
| ├─ public | ||
| │ ├─ images | ||
| │ ├─ javascripts | ||
| │ └─ stylesheets | ||
| │ └─ style.css | ||
| ├─ routes | ||
| │ ├─ index.js | ||
| │ └─ users.js | ||
| ├─ views | ||
| │ ├─ error.jade | ||
| │ ├─ index.jade | ||
| │ └─ layout.jade | ||
| ├─ app.js | ||
| └─ package.json | ||
| ``` | ||
| ### With params | ||
| ### Parse your dir with params | ||
| ``` | ||
| $ parse -e test1 -s | ||
| $ parse -e bin,public -n -s | ||
| $ cat dir-info.txt | ||
| dir | ||
| ├─ subdir2 | ||
| │ ├─ dem1 | ||
| │ │ └─ test1.txt | ||
| │ └─ dem2 | ||
| └─ README.md | ||
| app | ||
| ├─ routes | ||
| │ ├─ index.js | ||
| │ └─ users.js | ||
| ├─ views | ||
| │ ├─ error.jade | ||
| │ ├─ index.jade | ||
| │ └─ layout.jade | ||
| ├─ app.js | ||
| └─ package.json | ||
| ``` | ||
| ### Recommend usage | ||
| ### Recommend usages | ||
| ``` | ||
| # Usage 01 | ||
| #Hint: There should no white space in the excludes series! | ||
| $ parse -e .git,node_modules -x somedir/somefile | ||
| $ parse -e .git,node_modules -x bin/www | ||
| # Usage 01 | ||
| #Hint: There should no white space in the excludes Array! | ||
| $ parse -e ['.git','node_modules'] -x ['somedir/somefile'] | ||
| $ parse -e ['.git','node_modules'] -x ['bin/www'] | ||
| # Usage 03 | ||
| # Parse by a config file >> parser.json | ||
| # Parse by a config file, In parser.json: | ||
| { | ||
| "directory": "your/demo/dir", | ||
| "directory": "your/demo/app", | ||
| "output": "your/output/dir", | ||
@@ -77,3 +92,75 @@ "excludes": [ | ||
| } | ||
| $ parse -c ./parser.json | ||
| ``` | ||
| ### In javaScript code | ||
| ``` | ||
| $ npm install dir-parse funclib | ||
| $ vi test.js | ||
| const parse = require('dir-parse'); | ||
| const fn = require('funclib'); | ||
| const target = './'; | ||
| const excludes = [ '.git', 'node_modules' ]; | ||
| const parsed = parse(target, { 'excludes': excludes }); | ||
| const parsedInfo = fn.pick(parsed, [ 'dirName', 'dirNum', 'fileNum' ]); | ||
| fn.log(parsedInfo, '# Parsed Info', { isShowTime: false }); | ||
| fn.log(parsed.dirTree, '# Parsed Dir Tree', { isShowTime: false }); | ||
| $ node test.js | ||
| ================================================================== | ||
| # Parsed Info | ||
| ------------------------------------------------------------------ | ||
| { | ||
| "dirName": "dir-parser", | ||
| "dirNum": 7, | ||
| "fileNum": 29 | ||
| } | ||
| ================================================================== | ||
| ================================================================== | ||
| # Parsed Dir Tree | ||
| ------------------------------------------------------------------ | ||
| dir-parser ( Directorys: 7, Files: 29 ) | ||
| ├─ bin | ||
| │ └─ parser.js | ||
| ├─ node_modules | ||
| │ ├─ commander | ||
| │ │ ├─ typings | ||
| │ │ │ └─ index.d.ts | ||
| │ │ ├─ CHANGELOG.md | ||
| │ │ ├─ index.js | ||
| │ │ ├─ LICENSE | ||
| │ │ ├─ package.json | ||
| │ │ └─ Readme.md | ||
| │ ├─ funclib | ||
| │ │ ├─ funclib.core.js | ||
| │ │ ├─ funclib.js | ||
| │ │ ├─ funclib.min.js | ||
| │ │ ├─ index.d.ts | ||
| │ │ ├─ index.js | ||
| │ │ ├─ package.json | ||
| │ │ └─ README.md | ||
| │ └─ progress | ||
| │ ├─ lib | ||
| │ │ └─ node-progress.js | ||
| │ ├─ CHANGELOG.md | ||
| │ ├─ index.js | ||
| │ ├─ LICENSE | ||
| │ ├─ Makefile | ||
| │ ├─ package.json | ||
| │ └─ Readme.md | ||
| ├─ .gitignore | ||
| ├─ dir-info.txt | ||
| ├─ dir-parser.png | ||
| ├─ index.js | ||
| ├─ package-lock.json | ||
| ├─ package.json | ||
| ├─ README.md | ||
| └─ test.js | ||
| ================================================================== | ||
| ``` |
+2
-2
@@ -9,3 +9,3 @@ const fn = require('funclib'); | ||
| fn.log(fn.pick(parsed, ['dirName', 'dirNum', 'fileNum']), '# Parsed Info'); | ||
| fn.log(parsed.dirTree, '# Parsed Dir Tree'); | ||
| fn.log(fn.pick(parsed, ['dirName', 'dirNum', 'fileNum']), '# Parsed Info', { isShowTime: false }); | ||
| fn.log(parsed.dirTree, '# Parsed Dir Tree', { isShowTime: false }); |
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
163
111.69%1
-50%87867
-7.44%