depshield
Version:
Smart Dependency Analyzer & Optimizer - Find unused npm packages, reduce bundle size, and improve project health with AST-based detection.
12 lines (11 loc) • 422 B
JavaScript
import { glob } from 'glob';
export async function walkFiles(options) {
const { path: rootPath, include = ['**/*.{js,ts,jsx,tsx,mjs,cjs}'], exclude = ['**/node_modules/**', '**/dist/**', '**/build/**', '**/*.test.{js,ts}', '**/*.spec.{js,ts}'] } = options;
const files = await glob(include, {
cwd: rootPath,
ignore: exclude,
absolute: true,
nodir: true,
});
return files;
}