📦
@simbo/globby-has-matches
A utility to glob using globby and exit early once a match is found.
Ensures further globbing is cancelled as soon as possible
Returns true
as 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
Install @simbo/globby-has-matches
from the npm registry:
npm i [-D] @simbo/globby-has-matches
For a complete API reference, see the documentation.
import { globbyHasMatches } from 'globby-has-matches';
const hasMatches = await globbyHasMatches('.changesets/*.md');
if (hasMatches) {
console.log('Found Changesets');
} else {
console.log('No Changesets found');