Skip to content

A 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.

License

Notifications You must be signed in to change notification settings

j-p-d-e-v/tree-mapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A 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.

Resources

License

Stars

Watchers

Forks