Skip to content

Commit

Permalink
fixed typos in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
matutter committed Nov 1, 2016
1 parent f3d09a7 commit 2f8d28e
Show file tree
Hide file tree
Showing 3 changed files with 198 additions and 200 deletions.
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,20 @@ fs.walk('..', options).return(js_files)
## walk(root:String, opts:[object Object])

Walk will recursively walk a directory structure creating a _file tree_ as it progresses.
The _file tree_ is a composite of _"nodes"_ where each node is a `File` object and may be traversed by the `File.children` property;
`File.children` is an array of `File` objects.
The _file tree_ is a composite of _"nodes"_ where each node is a `File` object and may be traversed by the `File.children` property, or, File.parent.
`File.children` is an array of `File` objects and File.parent is mutable.

Walk will return the _root_ node once the promised is fulfilled.

`options.filter` is a _filter function_ on each node which determines if a node will be included, or excluded, from the _file tree_.
The filter option may also be an object with a `file` and `directory` filter function such as `{ file: f=>true, directory: d=>true }`;
These explicit _filter functions_ are passed either only files or directories respectively.
Walk will return the _root_ node once the promise is fulfilled.

The `onFile` and `onDirectory` functions are _handler_ functions which are pass the file or directory, the parent directory, and the options passed to
the _walk_ function (if any).
`options.filter` is a _filter function_ on each node which will filter the nodes inclusion within the _file tree_.
The filter option may also be an object with a `file` and `directory` _filter function_; example `{ file: f=>true, directory: d=>true }`.

The `onFile` and `onDirectory` functions are _handler_ functions which are passed either a file or directory & the parent directory if any.
Example: `{ onFile : (file, parent, options) => { ... } }`

The `filter`, if truthy, will flatten the _file tree_ before it is returned. This may also be a _filter function_ to return only specific Files.

The promissory chain will wait for all `filter`, `onFile`, `onDirectory` callbacks to finish if they return a promise; returning a promise is not necessary.
The promissory chain will wait for all `filter`, `onFile`, `onDirectory` callbacks to finish if they return a promise; returning a promise is not necessary.

## mkdirp(filepath:String)

Expand All @@ -110,7 +109,7 @@ fs.walk('..', options).return(js_files)
## touch(path:String|Buffer, truncate:Boolean, mode:Integer)

Creates a file if it does not exist by opening it with 'a+', or truncating it with 'w+' when the truncate flag is truthy.
Will fail if the file cannot be read or written to (EACCESS) or is an existing directory (EISDIR).
Will fail if the file cannot be read or written to (EACCESS) or is an existing directory (EISDIR).

## removerf(filepath:String)

Expand Down
21 changes: 10 additions & 11 deletions doc/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,20 @@
## walk(root:String, opts:[object Object])

Walk will recursively walk a directory structure creating a _file tree_ as it progresses.
The _file tree_ is a composite of _"nodes"_ where each node is a `File` object and may be traversed by the `File.children` property;
`File.children` is an array of `File` objects.
The _file tree_ is a composite of _"nodes"_ where each node is a `File` object and may be traversed by the `File.children` property, or, File.parent.
`File.children` is an array of `File` objects and File.parent is mutable.

Walk will return the _root_ node once the promised is fulfilled.

`options.filter` is a _filter function_ on each node which determines if a node will be included, or excluded, from the _file tree_.
The filter option may also be an object with a `file` and `directory` filter function such as `{ file: f=>true, directory: d=>true }`;
These explicit _filter functions_ are passed either only files or directories respectively.
Walk will return the _root_ node once the promise is fulfilled.

The `onFile` and `onDirectory` functions are _handler_ functions which are pass the file or directory, the parent directory, and the options passed to
the _walk_ function (if any).
`options.filter` is a _filter function_ on each node which will filter the nodes inclusion within the _file tree_.
The filter option may also be an object with a `file` and `directory` _filter function_; example `{ file: f=>true, directory: d=>true }`.

The `onFile` and `onDirectory` functions are _handler_ functions which are passed either a file or directory & the parent directory if any.
Example: `{ onFile : (file, parent, options) => { ... } }`

The `filter`, if truthy, will flatten the _file tree_ before it is returned. This may also be a _filter function_ to return only specific Files.

The promissory chain will wait for all `filter`, `onFile`, `onDirectory` callbacks to finish if they return a promise; returning a promise is not necessary.
The promissory chain will wait for all `filter`, `onFile`, `onDirectory` callbacks to finish if they return a promise; returning a promise is not necessary.

## mkdirp(filepath:String)

Expand All @@ -48,7 +47,7 @@
## touch(path:String|Buffer, truncate:Boolean, mode:Integer)

Creates a file if it does not exist by opening it with 'a+', or truncating it with 'w+' when the truncate flag is truthy.
Will fail if the file cannot be read or written to (EACCESS) or is an existing directory (EISDIR).
Will fail if the file cannot be read or written to (EACCESS) or is an existing directory (EISDIR).

## removerf(filepath:String)

Expand Down
Loading

0 comments on commit 2f8d28e

Please sign in to comment.