Ignore hidden files and folders #3

Open
opened 2020-01-10 18:33:58 +00:00 by Ghost · 1 comment

Hello! thanks for this plugin, it is really excellent and it is one of the few that truly respects the performance once executed.

I wanted to know more about the possibility of being able to avoid "walking" over hidden files and folders (ex: .dotfilerc).

Currently there seems to be no option to avoid this. There is the filters option but it seems that you cannot insert regex or something dynamic in order to avoid inspection on this type of files and folders.
Now I managed to get around the problem by adding a package (multimatch) and with a few lines of code I can prevent the walker from adding the hidden files to me:

  • root.indexOf ('.') === -1 &&! filestats.name.startsWith ('.')) in a .zip archive.

Since I should add some paths, as previously said, to a .zip archive, now the addition of hidden files and folders is correctly avoided ... but the walker still crosses the path with the hidden files and/or folders anyway, and this obviously increases the final wait for the final resolution of all the paths ... in case I add multiple large-scale files on the zip archive: ex. currently I go through all the .git folders (which have a lot of files inside) of each project, and I certainly wait a few seconds more than the filters option ... so I ask you it is possible to extend the plugin with a new option: maybe: (followHidden: Boolean) so that the final traversing speed of the files would be faster? Or if you know alternatives that allow me to recover speed performance in traversing files without adding other plugins, it would be very nice.

Thank you! 👍

Hello! thanks for this plugin, it is really excellent and it is one of the few that truly respects the **performance** once executed. I wanted to know more about the possibility of being able to avoid "walking" over hidden files and folders (ex: `.dotfilerc`). Currently there seems to be **no option** to avoid this. There is the `filters` option but it seems that you cannot insert regex or something dynamic in order to avoid inspection on this type of files and folders. Now I managed to get around the problem by adding a package ([_multimatch_](https://github.com/sindresorhus/multimatch)) and with a few lines of code I can prevent the `walker` from adding the hidden files to me: - `root.indexOf ('.') === -1 &&! filestats.name.startsWith ('.')`) in a `.zip` archive. Since I should add some paths, as previously said, to a `.zip` archive, now the addition of hidden files and folders is correctly avoided ... but the` walker` still crosses the path with the hidden files and/or folders anyway, and this obviously increases the final wait for the final resolution of all the paths ... in case I add multiple large-scale files on the zip archive: ex. currently I go through all the `.git` folders (which have a lot of files inside) of each project, and I certainly wait a few seconds more than the` filters` option ... so I ask you it is possible to extend the plugin with a new option: maybe: (`followHidden: Boolean`) so that the final traversing speed of the files would be faster? Or if you know alternatives that allow me to recover speed performance in traversing files without adding other plugins, it would be very nice. Thank you! :+1:
Owner

So sorry I never saw this.

I'd actually recommend using https://www.npmjs.com/package/@root/walk instead, which is far more performant and has much simpler options.

So sorry I never saw this. I'd actually recommend using https://www.npmjs.com/package/@root/walk instead, which is far more performant and has much simpler options.
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coolaj86/fs-walk.js#3
No description provided.