@@ -1360,9 +1360,9 @@ Example with filtered recursion.
13601360import { readdir } from 'node:fs/promises';
13611361
13621362try {
1363- const files = await readdir(path, { recursive: function (directory, depth) {
1363+ const files = await readdir(path, { recursive: function(directory, depth) {
13641364 return (directory.includes('system') && depth < 5);
1365- }});
1365+ } });
13661366 for (const file of files)
13671367 console.log(file);
13681368} catch (err) {
@@ -1378,13 +1378,13 @@ import { readdir } from 'node:fs/promises';
13781378try {
13791379 const files = await readdir(path, {
13801380 withFileTypes: true,
1381- recursive: function (dirent, depth) {
1381+ recursive: function(dirent, depth) {
13821382 return (
13831383 dirent.name.includes('system') &&
13841384 dirent.path.includes('games') &&
13851385 depth < 5
13861386 );
1387- }
1387+ },
13881388 });
13891389 for (const file of files)
13901390 console.log(file);
@@ -3743,7 +3743,7 @@ function callback(err, files) {
37433743fs .readdir (path, {
37443744 recursion : function (directory , depth ) {
37453745 return (directory .includes (' system' ) && depth < 5 );
3746- }
3746+ },
37473747}, callback);
37483748` ` `
37493749
@@ -3765,7 +3765,7 @@ fs.readdir(path, {
37653765 dirent .path .includes (' games' ) &&
37663766 depth < 5
37673767 );
3768- }
3768+ },
37693769}, callback);
37703770` ` `
37713771
@@ -5863,7 +5863,7 @@ import { readdir } from 'node:fs';
58635863const files = fs.readdir(path, {
58645864 recursion: function(directory, depth) {
58655865 return (directory.includes(' system' ) && depth < 5);
5866- }
5866+ },
58675867});
58685868```
58695869
@@ -5880,7 +5880,7 @@ const files = fs.readdir(path, {
58805880 dirent.path.includes(' games' ) &&
58815881 depth < 5
58825882 );
5883- }
5883+ },
58845884});
58855885```
58865886
0 commit comments