Ignore hidden files and folders #3

Açık
Ghost tarafından 2020-01-10 18:33:58 +00:00 açıldı · 1 yorum

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:
Sahibi

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.
Bu konuşmaya katılmak için oturum aç.
Etiket Yok
Kilometre Taşı Yok
Atanan Kişi Yok
2 Katılımcı
Bildirimler
Bitiş Tarihi
Bitiş tarihi geçersiz veya aralık dışında. Lütfen 'yyyy-aa-gg' biçimini kullanın.

Bitiş tarihi atanmadı.

Bağımlılıklar

Bağımlılık yok.

Referans: coolaj86/fs-walk.js#3
Herhangi bir açıklama sağlanmadı.