@@ -1069,6 +1069,38 @@ including subdirectories and files.
10691069When copying a directory to another directory, globs are not supported and
10701070behavior is similar to ` cp dir1/ dir2/ ` .
10711071
1072+ ### ` fsPromises .glob (patten[, options])`
1073+
1074+ <!-- YAML
1075+ added: REPLACEME
1076+ -->
1077+
1078+ > Stability: 1 - Experimental
1079+
1080+ * ` patten` {string|string\[ ]}
1081+ * ` options` {Object}
1082+ * ` cwd` {string} working directory. **Default:** ` process .cwd ()`
1083+ * ` exclude` {Function} Function to filter out files/directories. Return
1084+ ` true ` to exclude the item, ` false ` to include it. **Default:** ` undefined ` .
1085+ * Returns: {AsyncIterator} An AsyncIterator that yields the paths of files
1086+ that match the pattern.
1087+
1088+ ` ` ` mjs
1089+ import { glob } from ' node:fs/promises' ;
1090+
1091+ for await (const entry of glob (' **/*.js' ))
1092+ console .log (entry);
1093+ ` ` `
1094+
1095+ ` ` ` cjs
1096+ const { glob } = require (' node:fs/promises' );
1097+
1098+ (async () => {
1099+ for await (const entry of glob (' **/*.js' ))
1100+ console .log (entry);
1101+ })();
1102+ ` ` `
1103+
10721104### ` fsPromises .lchmod (path, mode)`
10731105
10741106<!-- YAML
@@ -5529,6 +5561,33 @@ changes:
55295561
55305562Synchronous version of [` fs .futimes ()` ][]. Returns ` undefined ` .
55315563
5564+ ### ` fs .globSync (patten[, options])`
5565+
5566+ <!-- YAML
5567+ added: REPLACEME
5568+ -->
5569+
5570+ > Stability: 1 - Experimental
5571+
5572+ * ` patten` {string|string\[ ]}
5573+ * ` options` {Object}
5574+ * ` cwd` {string} working directory. **Default:** ` process .cwd ()`
5575+ * ` exclude` {Function} Function to filter out files/directories. Return
5576+ ` true ` to exclude the item, ` false ` to include it. **Default:** ` undefined ` .
5577+ * Returns: {string\[ ]} paths of files that match the pattern.
5578+
5579+ ` ` ` mjs
5580+ import { globSync } from ' node:fs' ;
5581+
5582+ console .log (globSync (' **/*.js' ));
5583+ ` ` `
5584+
5585+ ` ` ` cjs
5586+ const { globSync } = require (' node:fs' );
5587+
5588+ console .log (globSync (' **/*.js' ));
5589+ ` ` `
5590+
55325591### ` fs .lchmodSync (path, mode)`
55335592
55345593<!-- YAML
0 commit comments