@@ -1360,9 +1360,9 @@ Example with filtered recursion.
1360
1360
import { readdir } from 'node:fs/promises';
1361
1361
1362
1362
try {
1363
- const files = await readdir(path, { recursive: function (directory, depth) {
1363
+ const files = await readdir(path, { recursive: function(directory, depth) {
1364
1364
return (directory.includes('system') && depth < 5);
1365
- }});
1365
+ } });
1366
1366
for (const file of files)
1367
1367
console.log(file);
1368
1368
} catch (err) {
@@ -1378,13 +1378,13 @@ import { readdir } from 'node:fs/promises';
1378
1378
try {
1379
1379
const files = await readdir(path, {
1380
1380
withFileTypes: true,
1381
- recursive: function (dirent, depth) {
1381
+ recursive: function(dirent, depth) {
1382
1382
return (
1383
1383
dirent.name.includes('system') &&
1384
1384
dirent.path.includes('games') &&
1385
1385
depth < 5
1386
1386
);
1387
- }
1387
+ },
1388
1388
});
1389
1389
for (const file of files)
1390
1390
console.log(file);
@@ -3743,7 +3743,7 @@ function callback(err, files) {
3743
3743
fs .readdir (path, {
3744
3744
recursion : function (directory , depth ) {
3745
3745
return (directory .includes (' system' ) && depth < 5 );
3746
- }
3746
+ },
3747
3747
}, callback);
3748
3748
` ` `
3749
3749
@@ -3765,7 +3765,7 @@ fs.readdir(path, {
3765
3765
dirent .path .includes (' games' ) &&
3766
3766
depth < 5
3767
3767
);
3768
- }
3768
+ },
3769
3769
}, callback);
3770
3770
` ` `
3771
3771
@@ -5863,7 +5863,7 @@ import { readdir } from 'node:fs';
5863
5863
const files = fs.readdir(path, {
5864
5864
recursion: function(directory, depth) {
5865
5865
return (directory.includes(' system' ) && depth < 5);
5866
- }
5866
+ },
5867
5867
});
5868
5868
```
5869
5869
@@ -5880,7 +5880,7 @@ const files = fs.readdir(path, {
5880
5880
dirent.path.includes(' games' ) &&
5881
5881
depth < 5
5882
5882
);
5883
- }
5883
+ },
5884
5884
});
5885
5885
```
5886
5886
0 commit comments