loading all files with certain name
See original GitHub issueAfter switching to klaw, I seem to be having some issue loading only files with a certain name.
Say I want to recursively load only files named package.json
. It seems like I could do something like:
var klawSync = require('klaw-sync')
var paths = klawSync('/some/dir', {ignore: '!**/package.json'})
I have also tried several other variations of the ignore pattern but nothing seems to match properly.
I am probably missing something obvious… Any ideas?
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (10 by maintainers)
Top Results From Across the Web
List all files of certain type in a directory using Python
List all files of a certain type using os.walk() function ... It returns all the file names in the directory specified in the...
Read more >Load files with certain names in R - Stack Overflow
I have thousands of files, but I only want to load some of them, those I want to load all are all named...
Read more >Loading files with a particular string on its name - MathWorks
I would like to load the files that have SVO, MID, and IC on its name separately. Is there a way of doing...
Read more >Python List Files in a Directory [5 Ways] - PYnative
In this article, we will see how to list all files of a directory in Python. There are multiple ways to list files...
Read more >51 How to load only specific files from a folder in SSIS
How to load only specific files from a folder in SSISDownload the file \script used in the Video from below ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It doesn’t work as I would have expected (when using a filter function). If I have the following example structure:
/tmp/dir1/dir2/file.txt
And I walked the directory at
/tmp
, then I would expect to see:If I leave off the
nodir: true
I see this now with 2.1.0. If I add this nodir option I would have expected to see just:/tmp/dir1/dir2/file.txt
But that is not what I get back. What I get back now is an empty array. What is happening is that once a directory is suppressed with the nodir option, then all subdirectories appear to be gone along with the files. The whole example structure above is gone, when I would have expected to still get the file.
When I do this without the filter function it works as expected, but then I lose the custom filtering.
Hope this helps.
Closes via https://github.com/manidlou/node-klaw-sync/commit/68d40ec5355fc6aa6645a1f48a7fd1b4825eaed9.