routender
Version:
An npm package to automatically detect and list all router endpoints in your application.
23 lines (19 loc) • 451 B
JavaScript
// src/utils/file-utils.js
const glob = require('glob');
const path = require('path');
function findFiles(options) {
const { patterns, ignore, projectRoot } = options;
let files = [];
patterns.forEach(pattern => {
const matches = glob.sync(pattern, {
cwd: projectRoot,
ignore,
absolute: true
});
files = [...files, ...matches];
});
return files;
}
module.exports = {
findFiles
};