1.0.6 • Published 8 months ago

@puppedo/walk-sync v1.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

@puppedo/walk-sync

Synchronously walks through a directory and its subdirectories, returning an array of file paths.

Coverage

Repository: https://github.com/starikan/PuppeDoWalkSync

Installation

npm install @puppedo/walk-sync

Usage

import { walkSync } from '@puppedo/walk-sync';

const files = walkSync('./my-directory', {
  ignoreFolders: ['node_modules', '.git'], // Optional: folders to exclude from the walk
  includeExtensions: ['.ts', '.js'], // Optional: only include files with these extensions
  ignoreFiles: ['.eslintrc.js', 'tsconfig.json'], // Optional: specific files to exclude
  depth: 2, // Optional: limits the recursion depth
  onlyFiles: ['package.json', 'index.ts'], // Optional: include only specific files
});

console.log(files); // Output: array of file paths

API

API Documentation

License

ISC