Comparing version 5.0.8 to 5.0.9
#!/usr/bin/env node | ||
import b from"yargs";import{hideBin as m}from"yargs/helpers";import{writeFileSync as u}from"node:fs";import*as s from"../lib/esm/index.esm.js";import{PostSortMethodPredefined as h,SortMethodPredefined as c}from"../lib/esm/index.esm.js";function y(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function a(t){let e=/^\/(?<pattern>.*)\/(?<flags>[igm]*)?$/;return t?t.map(n=>{let o=n.match(e);return o?new RegExp(y(o.groups.pattern),o.groups.flags):n}):[]}function p(t){if(t)switch(t){case"ascending":return c.ALPHABETICAL;case"descending":return c.ALPHABETICAL_REVERSE;default:return t}}function g(t){if(t)switch(t){case"ascending":return h.ALPHABETICAL;case"descending":return h.ALPHABETICAL_REVERSE;default:return t}}async function w(){await b(m(process.argv)).scriptName("dree").version("5.0.8").command("parse <source>","Save the directory tree as a text file",t=>{t.positional("source",{describe:"The path of the root of the directory tree",type:"string"})},t=>{let e=t,n={symbolicLinks:e.symbolicLinks,followLinks:e.followLinks,showHidden:e.showHidden,depth:e.depth,exclude:a(e.exclude),extensions:e.extensions,sorted:p(e.sorted),homeShortcut:e.homeShortcut,skipErrors:e.skipErrors},o=e.source,r=e.dest,i=!e.dest||e.show,d=s.parse(o,n);i&&console.log(d),r&&u(r,d)}).command("scan <source>","Save the directory tree as a json file",t=>{t.positional("source",{describe:"The path of the root of the directory tree",type:"string"}).options({tabs:{describe:"How many tabs will be used to indent the resulted json",type:"number",default:0},pretty:{describe:"If the resulted json will be pretty printed with 4 tabs. Overwrites the tabs option",type:"boolean",default:!1}})},t=>{let e=t,n={stat:e.stat,normalize:e.normalize,symbolicLinks:e.symbolicLinks,followLinks:e.followLinks,sizeInBytes:e.sizeInBytes,size:e.size,hash:e.hash,hashAlgorithm:e.hashAlgorithm,hashEncoding:e.hashEncoding,showHidden:e.showHidden,depth:e.depth,exclude:a(e.exclude),matches:a(e.matches),emptyDirectory:e.emptyDirectory,excludeEmptyDirectories:e.excludeEmptyDirectories,descendants:e.descendants,descendantsIgnoreDirectories:e.descendantsIgnoreDirectories,extensions:e.extensions,sorted:p(e.sorted),postSorted:g(e.postSorted),homeShortcut:e.homeShortcut,skipErrors:e.skipErrors},o=e.source,r=e.dest,i=!e.dest||e.show,f=e.pretty?4:e.tabs,l=JSON.stringify(s.scan(o,n),null,f);i&&console.log(l),r&&u(r,l)}).options({dest:{alias:"d",describe:"The path of the output file destination. If not specified, in any case the result will be printed on the command line.",type:"string"},show:{alias:"s",default:!1,describe:"Whether you want to print the result on the command line. This will be ignored and set to true if no destination is specified.",type:"boolean"},stat:{default:!1,describe:"Whether you want the fs.stat included in the json result",type:"boolean",hidden:!0},normalize:{default:!1,describe:"Whether you want to normalize the path in the json result",type:"boolean",hidden:!0},"symbolic-links":{default:!0,describe:"Whether you want to consider symbolic links during the elaboration, could not work on windows",type:"boolean",hidden:!0},"follow-links":{default:!1,describe:"Whether you want to follow symbolic links during the elaboration, could not work on windows",type:"boolean",hidden:!0},"size-in-bytes":{default:!0,describe:"Whether you want to include the size in bytes in the json result",type:"boolean",hidden:!0},size:{default:!0,describe:"Whether you want to include the size in a proper unit in the json result",type:"boolean",hidden:!0},hash:{default:!0,describe:"Whether you want to include the hash in the json result",type:"boolean",hidden:!0},"hash-algorithm":{default:"md5",describe:"The hash algorithm that you want to use for the hash in the json result",type:"string",choices:["md5","sha1"],hidden:!0},"hash-encoding":{default:"hex",describe:"The hash encoding that you want to use for the hash in the json result",type:"string",choiches:["hex","base64","latin1"],hidden:!0},"show-hidden":{default:!0,describe:"Whether you want to consider hidden files during the elaboration",type:"boolean",hidden:!0},depth:{default:void 0,describe:"The max depth wich could be reached during the elaboration from the given folder",type:"number",hidden:!0},exclude:{describe:"An array of strings (glob patterns) or regex (just write them as you would with js, e.g. /^[a-b]*$/g) whose all matched path will not be considered during the elaboration",type:"array",hidden:!0},matches:{describe:"An array of strings (glob patterns) or regex (just write them as you would with js, e.g. /^[a-b]*$/g) and all the non-matching paths will not be considered by the algorithm. Note: All the ancestors of a matching node will be added",type:"array",hidden:!0},extensions:{describe:"An array of strings containing all the extensions wich will be considered",type:"array",hidden:!0},"empty-directory":{default:!1,describe:"Whether you want to include the property isEmpty in the result",type:"boolean",hidden:!0},"exclude-empty-directories":{default:!1,describe:"Whether you want to exclude all the empty directories from the result, even if they contains nodes excluded by other options",type:"boolean",hidden:!0},sorted:{default:void 0,describe:"Whether you want the result to contain values sorted with a dree pre-defined sorting method. 'ascending' or 'descending' are kept for retrocompatibility. The sort is done before the scanning for the scan command. If not specified, the result values are not ordered.",type:"string",choices:[...Object.values(c),"ascending","descending"],hidden:!0},postSorted:{default:void 0,describe:"Whether you want the result to contain values sorted with a dree pre-defined sorting method. 'ascending' or 'descending' are kept for retrocompatibility. The sort is done after the scanning for the scan command. If not specified, the result values are not ordered.",type:"string",choices:[...Object.values(h),"ascending","descending"],hidden:!0},descendants:{default:!1,describe:"Whether you want the result to contain the number of descendants for each node",type:"boolean",hidden:!0},"descendants-ignore-directories":{default:!1,describe:"Whether you want the result directories to be ignored when calculating the number of descendants",type:"boolean",hidden:!0},"home-shortcut":{default:!1,describe:"Whether you want the unix homedir shortcut ~ to be expanded to the user home directory",type:"boolean",hidden:!0},"skip-errors":{default:!0,describe:"Whether you want to skip folders and files wich give errors during the execution",type:"boolean",hidden:!0},options:{alias:"o",describe:"A path to a json config file. If an option is both on the file and in the command, the command one will be considered",config:!0}}).showHidden("all-options").completion("completion","Creates the completion bash script to add o your .bashrc in order to have the tab autocompletion for this cli service").demandCommand(1,"You must specify a command").strict().epilogue("For more information, find our manual at https://github.com/euberdeveloper/dree#readme").argv}w(); | ||
import b from"yargs";import{hideBin as m}from"yargs/helpers";import{writeFileSync as u}from"node:fs";import*as s from"../lib/esm/index.esm.js";import{PostSortMethodPredefined as h,SortMethodPredefined as c}from"../lib/esm/index.esm.js";function y(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function a(t){let e=/^\/(?<pattern>.*)\/(?<flags>[igm]*)?$/;return t?t.map(n=>{let o=n.match(e);return o?new RegExp(y(o.groups.pattern),o.groups.flags):n}):[]}function p(t){if(t)switch(t){case"ascending":return c.ALPHABETICAL;case"descending":return c.ALPHABETICAL_REVERSE;default:return t}}function g(t){if(t)switch(t){case"ascending":return h.ALPHABETICAL;case"descending":return h.ALPHABETICAL_REVERSE;default:return t}}async function w(){await b(m(process.argv)).scriptName("dree").version("5.0.9").command("parse <source>","Save the directory tree as a text file",t=>{t.positional("source",{describe:"The path of the root of the directory tree",type:"string"})},t=>{let e=t,n={symbolicLinks:e.symbolicLinks,followLinks:e.followLinks,showHidden:e.showHidden,depth:e.depth,exclude:a(e.exclude),extensions:e.extensions,sorted:p(e.sorted),homeShortcut:e.homeShortcut,skipErrors:e.skipErrors},o=e.source,r=e.dest,i=!e.dest||e.show,d=s.parse(o,n);i&&console.log(d),r&&u(r,d)}).command("scan <source>","Save the directory tree as a json file",t=>{t.positional("source",{describe:"The path of the root of the directory tree",type:"string"}).options({tabs:{describe:"How many tabs will be used to indent the resulted json",type:"number",default:0},pretty:{describe:"If the resulted json will be pretty printed with 4 tabs. Overwrites the tabs option",type:"boolean",default:!1}})},t=>{let e=t,n={stat:e.stat,normalize:e.normalize,symbolicLinks:e.symbolicLinks,followLinks:e.followLinks,sizeInBytes:e.sizeInBytes,size:e.size,hash:e.hash,hashAlgorithm:e.hashAlgorithm,hashEncoding:e.hashEncoding,showHidden:e.showHidden,depth:e.depth,exclude:a(e.exclude),matches:a(e.matches),emptyDirectory:e.emptyDirectory,excludeEmptyDirectories:e.excludeEmptyDirectories,descendants:e.descendants,descendantsIgnoreDirectories:e.descendantsIgnoreDirectories,extensions:e.extensions,sorted:p(e.sorted),postSorted:g(e.postSorted),homeShortcut:e.homeShortcut,skipErrors:e.skipErrors},o=e.source,r=e.dest,i=!e.dest||e.show,f=e.pretty?4:e.tabs,l=JSON.stringify(s.scan(o,n),null,f);i&&console.log(l),r&&u(r,l)}).options({dest:{alias:"d",describe:"The path of the output file destination. If not specified, in any case the result will be printed on the command line.",type:"string"},show:{alias:"s",default:!1,describe:"Whether you want to print the result on the command line. This will be ignored and set to true if no destination is specified.",type:"boolean"},stat:{default:!1,describe:"Whether you want the fs.stat included in the json result",type:"boolean",hidden:!0},normalize:{default:!1,describe:"Whether you want to normalize the path in the json result",type:"boolean",hidden:!0},"symbolic-links":{default:!0,describe:"Whether you want to consider symbolic links during the elaboration, could not work on windows",type:"boolean",hidden:!0},"follow-links":{default:!1,describe:"Whether you want to follow symbolic links during the elaboration, could not work on windows",type:"boolean",hidden:!0},"size-in-bytes":{default:!0,describe:"Whether you want to include the size in bytes in the json result",type:"boolean",hidden:!0},size:{default:!0,describe:"Whether you want to include the size in a proper unit in the json result",type:"boolean",hidden:!0},hash:{default:!0,describe:"Whether you want to include the hash in the json result",type:"boolean",hidden:!0},"hash-algorithm":{default:"md5",describe:"The hash algorithm that you want to use for the hash in the json result",type:"string",choices:["md5","sha1"],hidden:!0},"hash-encoding":{default:"hex",describe:"The hash encoding that you want to use for the hash in the json result",type:"string",choiches:["hex","base64","latin1"],hidden:!0},"show-hidden":{default:!0,describe:"Whether you want to consider hidden files during the elaboration",type:"boolean",hidden:!0},depth:{default:void 0,describe:"The max depth wich could be reached during the elaboration from the given folder",type:"number",hidden:!0},exclude:{describe:"An array of strings (glob patterns) or regex (just write them as you would with js, e.g. /^[a-b]*$/g) whose all matched path will not be considered during the elaboration",type:"array",hidden:!0},matches:{describe:"An array of strings (glob patterns) or regex (just write them as you would with js, e.g. /^[a-b]*$/g) and all the non-matching paths will not be considered by the algorithm. Note: All the ancestors of a matching node will be added",type:"array",hidden:!0},extensions:{describe:"An array of strings containing all the extensions wich will be considered",type:"array",hidden:!0},"empty-directory":{default:!1,describe:"Whether you want to include the property isEmpty in the result",type:"boolean",hidden:!0},"exclude-empty-directories":{default:!1,describe:"Whether you want to exclude all the empty directories from the result, even if they contains nodes excluded by other options",type:"boolean",hidden:!0},sorted:{default:void 0,describe:"Whether you want the result to contain values sorted with a dree pre-defined sorting method. 'ascending' or 'descending' are kept for retrocompatibility. The sort is done before the scanning for the scan command. If not specified, the result values are not ordered.",type:"string",choices:[...Object.values(c),"ascending","descending"],hidden:!0},postSorted:{default:void 0,describe:"Whether you want the result to contain values sorted with a dree pre-defined sorting method. 'ascending' or 'descending' are kept for retrocompatibility. The sort is done after the scanning for the scan command. If not specified, the result values are not ordered.",type:"string",choices:[...Object.values(h),"ascending","descending"],hidden:!0},descendants:{default:!1,describe:"Whether you want the result to contain the number of descendants for each node",type:"boolean",hidden:!0},"descendants-ignore-directories":{default:!1,describe:"Whether you want the result directories to be ignored when calculating the number of descendants",type:"boolean",hidden:!0},"home-shortcut":{default:!1,describe:"Whether you want the unix homedir shortcut ~ to be expanded to the user home directory",type:"boolean",hidden:!0},"skip-errors":{default:!0,describe:"Whether you want to skip folders and files wich give errors during the execution",type:"boolean",hidden:!0},options:{alias:"o",describe:"A path to a json config file. If an option is both on the file and in the command, the command one will be considered",config:!0}}).showHidden("all-options").completion("completion","Creates the completion bash script to add o your .bashrc in order to have the tab autocompletion for this cli service").demandCommand(1,"You must specify a command").strict().epilogue("For more information, find our manual at https://github.com/euberdeveloper/dree#readme").argv}w(); |
{ | ||
"name": "dree", | ||
"version": "5.0.8", | ||
"version": "5.0.9", | ||
"description": "A nodejs module wich helps you handle a directory tree providing you its abstraction through tested functions and a custom configuration.", | ||
@@ -87,2 +87,3 @@ "main": "bundled/lib/commonjs/index.js", | ||
"minimatch": "^10.0.1", | ||
"typedoc-plugin-ga": "^1.0.1", | ||
"yargs": "^17.7.2" | ||
@@ -92,4 +93,4 @@ }, | ||
"@release-it/conventional-changelog": "^8.0.1", | ||
"@types/node": "^20.14.10", | ||
"@types/yargs": "^17.0.32", | ||
"@types/node": "^22.3.0", | ||
"@types/yargs": "^17.0.33", | ||
"c8": "^10.1.2", | ||
@@ -102,8 +103,8 @@ "chai": "^5.1.1", | ||
"esbuild-plugin-import-map": "^2.1.0", | ||
"mocha": "^10.6.0", | ||
"release-it": "^17.5.0", | ||
"mocha": "^10.7.3", | ||
"release-it": "^17.6.0", | ||
"shx": "^0.3.4", | ||
"typedoc": "^0.26.3", | ||
"typescript": "^5.5.3" | ||
"typedoc": "^0.26.5", | ||
"typescript": "^5.5.4" | ||
} | ||
} |
## [5.0.9](https://github.com/euberdeveloper/dree/compare/5.0.8...5.0.9) (2024-08-15) | ||
## [5.0.8](https://github.com/euberdeveloper/dree/compare/5.0.7...5.0.8) (2024-07-09) | ||
@@ -4,0 +6,0 @@ |
{ | ||
"name": "dree", | ||
"version": "5.0.8", | ||
"version": "5.0.9", | ||
"description": "A nodejs module wich helps you handle a directory tree providing you its abstraction through tested functions and a custom configuration.", | ||
@@ -88,2 +88,3 @@ "main": "bundled/lib/commonjs/index.js", | ||
"minimatch": "^10.0.1", | ||
"typedoc-plugin-ga": "^1.0.1", | ||
"yargs": "^17.7.2" | ||
@@ -93,4 +94,4 @@ }, | ||
"@release-it/conventional-changelog": "^8.0.1", | ||
"@types/node": "^20.14.10", | ||
"@types/yargs": "^17.0.32", | ||
"@types/node": "^22.3.0", | ||
"@types/yargs": "^17.0.33", | ||
"c8": "^10.1.2", | ||
@@ -103,8 +104,8 @@ "chai": "^5.1.1", | ||
"esbuild-plugin-import-map": "^2.1.0", | ||
"mocha": "^10.6.0", | ||
"release-it": "^17.5.0", | ||
"mocha": "^10.7.3", | ||
"release-it": "^17.6.0", | ||
"shx": "^0.3.4", | ||
"typedoc": "^0.26.3", | ||
"typescript": "^5.5.3" | ||
"typedoc": "^0.26.5", | ||
"typescript": "^5.5.4" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
106396
3
+ Addedtypedoc-plugin-ga@^1.0.1
+ Added@shikijs/core@1.17.5(transitive)
+ Added@shikijs/engine-javascript@1.17.5(transitive)
+ Added@shikijs/engine-oniguruma@1.17.5(transitive)
+ Added@shikijs/types@1.17.5(transitive)
+ Added@shikijs/vscode-textmate@9.2.2(transitive)
+ Added@types/hast@3.0.4(transitive)
+ Added@types/mdast@4.0.4(transitive)
+ Added@types/unist@3.0.3(transitive)
+ Added@ungap/structured-clone@1.2.0(transitive)
+ Addedargparse@2.0.1(transitive)
+ Addedccount@2.0.1(transitive)
+ Addedcharacter-entities-html4@2.1.0(transitive)
+ Addedcharacter-entities-legacy@3.0.0(transitive)
+ Addedcomma-separated-tokens@2.0.3(transitive)
+ Addeddequal@2.0.3(transitive)
+ Addeddevlop@1.1.0(transitive)
+ Addedentities@4.5.0(transitive)
+ Addedhast-util-to-html@9.0.2(transitive)
+ Addedhast-util-whitespace@3.0.0(transitive)
+ Addedhtml-void-elements@3.0.0(transitive)
+ Addedlinkify-it@5.0.0(transitive)
+ Addedlunr@2.3.9(transitive)
+ Addedmarkdown-it@14.1.0(transitive)
+ Addedmdast-util-to-hast@13.2.0(transitive)
+ Addedmdurl@2.0.0(transitive)
+ Addedmicromark-util-character@2.1.0(transitive)
+ Addedmicromark-util-encode@2.0.0(transitive)
+ Addedmicromark-util-sanitize-uri@2.0.0(transitive)
+ Addedmicromark-util-symbol@2.0.0(transitive)
+ Addedmicromark-util-types@2.0.0(transitive)
+ Addedminimatch@9.0.5(transitive)
+ Addedoniguruma-to-js@0.4.0(transitive)
+ Addedproperty-information@6.5.0(transitive)
+ Addedpunycode.js@2.3.1(transitive)
+ Addedregex@4.3.2(transitive)
+ Addedshiki@1.17.5(transitive)
+ Addedspace-separated-tokens@2.0.2(transitive)
+ Addedstringify-entities@4.0.4(transitive)
+ Addedtrim-lines@3.0.1(transitive)
+ Addedtypedoc@0.26.7(transitive)
+ Addedtypedoc-plugin-ga@1.0.4(transitive)
+ Addedtypescript@5.6.2(transitive)
+ Addeduc.micro@2.1.0(transitive)
+ Addedunist-util-is@6.0.0(transitive)
+ Addedunist-util-position@5.0.0(transitive)
+ Addedunist-util-stringify-position@4.0.0(transitive)
+ Addedunist-util-visit@5.0.0(transitive)
+ Addedunist-util-visit-parents@6.0.1(transitive)
+ Addedvfile@6.0.3(transitive)
+ Addedvfile-message@4.0.2(transitive)
+ Addedyaml@2.5.1(transitive)
+ Addedzwitch@2.0.4(transitive)