.npmignore parsing and filtering.
Walk a directory creating a list of entries, parsing any
files met along the way to exclude files.
const walk =// All options are optional, defaults provided.// this function returns a promise, but you can also pass a cb// if you like that approach better.// to walk synchronously, do it this way:const result = walk
If you want to get at the underlying classes, they're at
pathThe path to start in. Defaults to
ignoreFilesFilenames to treat as ignore files. The default is
['.ignore']. (This is where you'd put
.npmignoreor whatever.) If multiple ignore files are in a directory, then rules from each are applied in the order that the files are listed.
trueto include empty directories, assuming they are not excluded by any of the ignore rules. If not set, then this follows the standard
gitbehavior of not including directories that are empty.
Note: this will cause an empty directory to be included if it would contain an included entry, even if it would have otherwise been excluded itself.
For example, given the rules
*(ignore everything) and
!/a/b/c(re-include the entry at
/a/b/c), the directory
/a/bwill be included if it is empty.
trueto treat symbolically linked directories as directories, recursing into them. There is no handling for nested symlinks, so
ELOOPerrors can occur in some cases when using this option. Defaults to