pathlength is a simple file path length checker for node.js.
Install from npm:
Usage: pathlength [options] [target] Options: -h, --help output usage information -V, --version output the version number -d, --debug output debug messages -f, --filter [expression] filter expression to use -n, --no-headers don't output headers for certain formats -o, --output [format] format for output -p, --progressive output matches as they are found -r, --recursive check directories recursively -s, --stop don't search unfiltered directories
Recursively check for all files within a
Temp directory with a path longer than 255 characters:
Check for paths length longer than that of the target file/directory:
Format the result output as a padded table with headers:
Path Length Type /Users/neocotic/Temp/bar.txt 28 File /Users/neocotic/Temp/foo.txt 28 File /Users/neocotic/Temp/sub 24 Directory /Users/neocotic/Temp/sub/baz.txt 32 File /Users/neocotic/Temp/sub/fu.txt 31 File
Output the results of the search as they are found:
Path Length Type /Users/neocotic/Temp 20 Directory
find([options][, callback]) is used primarily:
The following options are recognised by this method (all of which are optional);
|context||Context in which to call the callback function|
|filter||Filter expression used to check files/directories|
|recursive||Check directories recursively|
|stop||Don't check children of unfiltered directories|
|target||Target file/directory to check|
Get notified whenever a matching file/directory has been found:
The following events can be triggered by this method;
|start||...after handling all arguments|
|afterStart||...before the first beforeData event|
|betweenData||...before all other beforeData events|
|beforeData||...before all data events (
|data||...when the result has been stored in the data set (
|afterData||...after all data events (
|beforeEnd||...after the last afterData event (
|end||...in parallel with the callback function (
Filters simply consist of a comparison operator followed by an operand.
A wildcard (
*) character replaces any invalid filter component(s), which will result in all files and
directories being included in the results.
||Not equal to|
||Greater than or equal to|
||Less than or equal to|
Operands can consist of numeric characters or one of the following special characters, which are replaced with their corresponding value:
||Length of the target file/directory|
If you have any problems with this library or would like to see the changes currently in development browse our issues.
Take a look at the documentation to get a better understanding of what the code is doing.
If that doesn't help, feel free to follow me on Twitter, @neocotic.