@simbo/globby-has-matches
v1.0.5
Published
A utility to glob using globby and exit early if there are any findings.
Maintainers
Readme
Globby Has Matches
A utility to glob using globby and exit early once a match is found.
Features
Ensures further globbing is cancelled as soon as possible
Returns
trueas soon as a matching file is found (no need to wait for the full scan)Optional matcher function for custom filtering logic
Fully async, Promise-based API
Fully typed with TypeScript
Installation
Install @simbo/globby-has-matches from the npm registry:
npm i [-D] @simbo/globby-has-matchesUsage
For a complete API reference, see the documentation.
Example
import { globbyHasMatches } from 'globby-has-matches';
const hasMatches = await globbyHasMatches('.changesets/*.md');
if (hasMatches) {
console.log('Found Changesets');
} else {
console.log('No Changesets found');