Crates.io | file-finder |
lib.rs | file-finder |
version | 0.1.0 |
source | src |
created_at | 2022-11-20 21:35:07.960374 |
updated_at | 2022-11-20 21:35:07.960374 |
description | An easy to use library to find the files you want |
homepage | https://github.com/flickyiyo/file-finder |
repository | https://github.com/flickyiyo/file-finder |
max_upload_size | |
id | 719418 |
size | 7,995 |
Just import and call the function, use std lib &Path
to filter and find your files.
let config = FileFinderConfig {
dir: Some("subpath") // Defaults ".",
filter: Some(|path| {
path.ends_with(".js") // Gets only js files
}),
skipped_dirs: Some(|path| {
path.ends_with("node_modules") // Skips children of every `node_modules` dir inside `dir` proeprty.
}),
err_behavior: ErrorBehavior::Log // Will log error messages but continue execution
}
let found_files: Vec<PathBuf> = find_files(config)