Package Exports
- esc-get-matching-files-array
- esc-get-matching-files-array/main.mjs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (esc-get-matching-files-array) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
esc-get-matching-files-array
A synchronous function that returns an array of files matching a regex pattern, recursively in a specified directory.
Want async version?
esc-get-matching-files-array-async
Features
- No dependencies
- Stable API
- Simple
- Small: 367 bytes, 3 lines of code
- Easy to audit
No breaking changes. If something radically different is needed, a new package will be made instead.
Inspired by
glob
The problems with glob are (as of 2025-08-15)
- 6 Dependencies
- 475KiB package size. What the actual fuck?
- Slow in some situations
- Hard to audit and trust
- Over-complicated
- Subject to change: 11 major versions thus far
Installation
npm install esc-get-matching-files-arrayUsage
import { getMatchingFilesA } from 'esc-get-matching-files-array';
const filesA = getMatchingFilesA('/some/path', /\.js$/);
console.log(filesA);API
getMatchingFilesA(dirPath: string, filenameRegex?: RegExp): string[]
- dirPath: Directory to start searching from (string).
- filenameRegex: Optional. Regex to match file names. Defaults to
/\.m?js$/.
Returns an array of absolute file paths matching the pattern.
License
MIT
⭐ Star the repo:
https://github.com/softwarecreations/esc-get-matching-files-array
PRs and issues are welcome!
Have fun!