ignore-walk (original) (raw)

7.0.0 • Public • Published 8 months ago

ignore-walk

Nested/recursive .gitignore/.npmignore parsing and filtering.

Walk a directory creating a list of entries, parsing any .ignorefiles met along the way to exclude files.

USAGE

const walk = require('ignore-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. walk({ path: '...', // root dir to start in. defaults to process.cwd() ignoreFiles: [ '.gitignore' ], // list of filenames. defaults to ['.ignore'] includeEmpty: true|false, // true to include empty dirs, default false follow: true|false // true to follow symlink dirs, default false }, callback)

// to walk synchronously, do it this way: const result = walk.sync({ path: '/wow/such/filepath' })

If you want to get at the underlying classes, they're at walk.Walkerand walk.WalkerSync.

OPTIONS