Skip to content

Commit

Permalink
Update with windows example
Browse files Browse the repository at this point in the history
  • Loading branch information
bcomnes committed Dec 27, 2019
1 parent a185429 commit 4d341a0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ The `shaper` function lets you change the shape of the returned value based on d
}
````

Example of a fwData object:
Example of a fwData object for a directory:

```js
{
Expand Down Expand Up @@ -120,6 +120,37 @@ Example of a fwData object:
}
```

and another example for a file on windows:

```js
{
root: 'D:\\a\\async-folder-walker\\async-folder-walker\\fixtures',
filepath: 'D:\\a\\async-folder-walker\\async-folder-walker\\fixtures\\sub-folder\\sub-sub-folder\\sub-sub-folder-file.json',
stat: Stats {
dev: 1321874112,
mode: 33206,
nlink: 1,
uid: 0,
gid: 0,
rdev: 0,
blksize: 4096,
ino: 562949953421580,
size: 37,
blocks: 0,
atimeMs: 1577476819530.035,
mtimeMs: 1577476819530.035,
ctimeMs: 1577476819530.035,
birthtimeMs: 1577476819530.035,
atime: 2019-12-27T20:00:19.530Z,
mtime: 2019-12-27T20:00:19.530Z,
ctime: 2019-12-27T20:00:19.530Z,
birthtime: 2019-12-27T20:00:19.530Z
},
relname: 'sub-folder\\sub-sub-folder\\sub-sub-folder-file.json',
basename: 'sub-sub-folder-file.json'
}
```

The `stat` property is an instance of [fs.Stats](https://nodejs.org/api/fs.html#fs_class_fs_stats) so it has extra methods not listed here.

### `files = await allFiles(paths, [opts])`
Expand Down
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tap.test('Array from async iterator', async t => {
t.equal(files.length, 4, 'expected number of files are found')
})

tap.test('Shape example', async t => {
tap.skip('Shape example', async t => {
await allFiles([fixtures], {
shaper: fwData => {
console.log(fwData)
Expand Down

0 comments on commit 4d341a0

Please sign in to comment.