@@ -17,7 +17,7 @@ npm i glob
1717```
1818
1919** Note** the npm package name is _ not_ ` node-glob ` that's a
20- different thing that was abandoned years ago. Just ` glob ` .
20+ different thing that was abandoned years ago. Just ` glob ` .
2121
2222``` js
2323// load using import
@@ -100,20 +100,20 @@ const groupReadableFiles = results
100100// you'll ignore all markdown files, and all folders named 'docs'
101101const customIgnoreResults = await glob (' **' , {
102102 ignore: {
103- ignored : ( p ) => / \. md$ / .test (p .name ),
104- childrenIgnored : ( p ) => p .isNamed (' docs' ),
103+ ignored : p => / \. md$ / .test (p .name ),
104+ childrenIgnored : p => p .isNamed (' docs' ),
105105 },
106106})
107107
108108// another fun use case, only return files with the same name as
109109// their parent folder, plus either `.ts` or `.js`
110110const folderNamedModules = await glob (' **/*.{ts,js}' , {
111111 ignore: {
112- ignored : ( p ) => {
112+ ignored : p => {
113113 const pp = p .parent
114114 return ! (p .isNamed (pp .name + ' .ts' ) || p .isNamed (pp .name + ' .js' ))
115- }
116- }
115+ },
116+ },
117117})
118118
119119// find all files edited in the last hour, to do this, we ignore
@@ -124,14 +124,14 @@ const newFiles = await glob('**', {
124124 // only want the files, not the dirs
125125 nodir: true ,
126126 ignore: {
127- ignored : ( p ) => {
128- return ( new Date () - p .mtime ) > ( 60 * 60 * 1000 )
127+ ignored : p => {
128+ return new Date () - p .mtime > 60 * 60 * 1000
129129 },
130130 // could add similar childrenIgnored here as well, but
131131 // directory mtime is inconsistent across platforms, so
132132 // probably better not to, unless you know the system
133133 // tracks this reliably.
134- }
134+ },
135135})
136136```
137137
@@ -431,7 +431,7 @@ share the previously loaded cache.
431431 ` absolute ` may not be used along with ` withFileTypes ` .
432432
433433- ` posix ` Set to true to use ` / ` as the path separator in
434- returned results. On posix systems, this has no effect. On
434+ returned results. On posix systems, this has no effect. On
435435 Windows systems, this will return ` / ` delimited path results,
436436 and absolute paths will be returned in their full resolved UNC
437437 path form, eg insted of ` 'C:\\foo\\bar' ` , it will return
0 commit comments