@andrerodrigo/path-tracer
v1.0.2
Published
CLI tool to quickly trace file paths
Maintainers
Readme
🔍 Path Tracer 🔍
This script automates the process of locating and writing paths for a list of specified components/files within your project directory structure. :file_folder: It's particularly useful when you need to document paths of certain components in your project's directory, instead of doing it manually.
Prerequisites
Before you begin, make sure you have Node.js installed on your machine.
Installation
You can install this tool via npm:
npm i -g @andrerodrigo/path-tracerUsage
To use the script, follow these steps:
Open your terminal.
Navigate to the directory containing the script and run the following command:
path-tracer [componentName1.ex] [componentName2.ex] ...Replace
[componentName1.ex],[componentName2.ex], etc. with the names of the components you want to find.For example:
path-tracer Button.tsx Modal.tsxThis will search for the paths of the components named "Button" and "Modal" within the current directory and its subdirectories.
The script will display a progress bar indicating the search progress.
Once the search is complete, the script will write the paths of the components to a file named
components_paths.txt. This file will be created on your desktop or in the script's directory, depending on your operating system.
Notes
- If NO component names and extensions are provided as command-line arguments, an error message will be displayed.
- The script searches for components recursively in the specified directory and its subdirectories.
- If a component is found, its path will be displayed next to its name. If not found, "Not found" will be indicated.
