Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
globby is a .gitignore
-style
file globber for JavaScript. It's not a general replacement for glob,
but it is potentially a better choice if you're globbing a large js
project and applying a long list of exclusion patterns.
not to be confused with the other globby. sadlol story here (i thought i had learned my lesson after the i18nline/i18nliner fiasco, but apparently not).
npm install gglobby
var Globby = require('gglobby');
// all files matched by the rules
Globby.select(rules).files;
// all other files
Globby.reject(rules).files;
// ooh chaining!
Globby.select(rules).reject(other_rules).files;
> var rules = fs.readFileSync('.gitignore').split(/\n/)
=> ["/node_modules", "/tmp", "/build"]
> Globby.select(rules).result
=> [
"node_modules/browserify/.npmignore",
"node_modules/browserify/.travis.yml",
...
"tmp/test/extractors/translate_call_test.js",
"tmp/test/extractors/translation_hash_test.js"
]
.gitignore
'd and/or you want to do something
with those files.globby is compatible with .gitignore
rules; it respects negated patterns, and
ignores comments or empty patterns. That said, it supports some things that may
or may not work in your version of git. These platform-dependent .gitignore
behaviors are platform independent in globby and can always be used:
**
matches directories recursively.Copyright (c) 2015 Jon Jensen, released under the MIT license
FAQs
a .gitignore-compatible file globber
We found that gglobby demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.