Skip to content

Commit

Permalink
bug in readme example code
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Mar 3, 2023
1 parent 6dcdd41 commit e85032b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,16 @@ const folderNamedModules = await glob('**/*.{ts,js}', {
}
})

// find all files edited in the last hour
// find all files edited in the last hour, to do this, we ignore
// all of them that are more than an hour old
const newFiles = await glob('**', {
// need stat so we have mtime
stat: true,
// only want the files, not the dirs
nodir: true,
ignore: {
ignored: (p) => {
return (new Date() - p.mtime) <= (60 * 60 * 1000)
return (new Date() - p.mtime) > (60 * 60 * 1000)
},
// could add similar childrenIgnored here as well, but
// directory mtime is inconsistent across platforms, so
Expand Down

0 comments on commit e85032b

Please sign in to comment.