tree-mapper

Crates.iotree-mapper
lib.rstree-mapper
version0.1.0
sourcesrc
created_at2024-08-30 19:13:49.522981
updated_at2024-08-30 19:13:49.522981
descriptionA utility for generating a hierarchical mapping of files and directories represented as a HashMap. The mapping reflects the directory structure and file levels, allowing for efficient retrieval and analysis of file system organization.
homepage
repositoryhttps://github.com/j-p-d-e-v/tree-mapper.git
max_upload_size
id1358060
size17,531
JP (jpmateo022)

documentation

README

TreeMapper

Overview

This utility generates a hierarchical mapping of files and directories, represented as a HashMap. It reflects the structure of directories and files based on their levels, providing a clear view of the organization of the file system.

Installation

cargo add tree-mapper

Usage

Explore a directory then convert it to json string.

use std::collections::HashMap;
use std::path::Path;
use tree_mapper::explore;
use tree_mapper::TreeType;
let base_path: String = String::from("storage/test-data");
let mut data: HashMap<String,Vec<TreeType>> = HashMap::new();
explore(Path::new(&base_path),&mut data,1);
let mapping: String = to_json(data);
println!("{}",mapping);

Contributing

Feel free to open issues or submit pull requests for enhancements and bug fixes.

License

This project is licensed under the MIT License.

Commit count: 0

cargo fmt