@@ -44,15 +44,16 @@ const options = {
4444 stat: true
4545};
4646
47- await walk('.', options);
47+ walk('.', options)
48+ .then(() => {
49+ console.log('total bytes in "."', ctx.total);
50+ });
4851
49- console.log('total bytes in "."', ctx.total);
50-
51- // executed in the await-walk package root it will print something like
52+ // executed in the action-walk package root it will print something like
5253// total bytes in "." 14778
5354```
5455
55- see ` test/basics.test.js ` for another example .
56+ see ` test/basics.test.js ` or ` bin/walk.js ` for other examples .
5657
5758### api
5859
@@ -63,9 +64,9 @@ options
6364- ` fileAction ` - called for each file and, if ` options.linkAction ` is not set, each symbolic link.
6465- ` linkAction ` - called for each symbolic link when ` options.linkAction ` is set.
6566- ` otherAction ` - called when the entry is not a file, directory, or symbolic link.
66- - ` stat ` - if ` lstat ` call ` fs.lstat ` on the entry and add it to the action context. if
67- otherwise truthy use ` fs.stat ` .
68- - ` own ` - add this to the action context. it is context for the action functions.
67+ - ` stat ` - if ` ' lstat' ` call ` fs.lstat ` on the entry and add it to the action context's ` stat `
68+ property. if otherwise truthy use ` fs.stat ` .
69+ - ` own ` - add this to the action context. it is your context for the action functions.
6970
7071It's possible to call ` walk() ` with no options but probably not useful unless
7172all you're wanting to do is seed the disk cache with directory entries. The
@@ -81,6 +82,7 @@ will be `test/basics.test.js`.
8182{
8283 dirent, // the fs.Dirent object for the directory entry
8384 stat, // if `options.stat` the object returned by `fs.stat` or `fs.lstat`
85+ stack, // the stack of directories above the current dirent item.
8486 own // `options.own` if provided.
8587}
8688```
0 commit comments