Security News
New Proposed CISA Mandate Would Require Critical Infrastructure to Report Ransom Payments Within 24 Hours
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
ignore-walk
Advanced tools
Nested/recursive `.gitignore`/`.npmignore` parsing and filtering.
Weekly downloads
Readme
Nested/recursive .gitignore
/.npmignore
parsing and filtering.
Walk a directory creating a list of entries, parsing any .ignore
files met along the way to exclude files.
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.Walker
and walk.WalkerSync
.
path
The path to start in. Defaults to process.cwd()
ignoreFiles
Filenames to treat as ignore files. The default is
['.ignore']
. (This is where you'd put .gitignore
or
.npmignore
or whatever.) If multiple ignore files are in a
directory, then rules from each are applied in the order that the
files are listed.
includeEmpty
Set to true
to include empty directories, assuming
they are not excluded by any of the ignore rules. If not set, then
this follows the standard git
behavior 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/b
will be
included if it is empty.
follow
Set to true
to treat symbolically linked directories as
directories, recursing into them. There is no handling for nested
symlinks, so ELOOP
errors can occur in some cases when using this
option. Defaults to false
.
FAQs
Nested/recursive `.gitignore`/`.npmignore` parsing and filtering.
The npm package ignore-walk receives a total of 7,648,674 weekly downloads. As such, ignore-walk popularity was classified as popular.
We found that ignore-walk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
Security News
Redis is no longer OSS, breaking its explicit commitment to remain under the BSD 3-Clause License forever. This has angered contributors who are now working to fork the software.
Product
Socket AI now enables 'AI detected potential malware' alerts by default, ensuring users benefit from AI-powered state-of-the-art malware detection without needing to opt-in.