@aayank13/dir_manager
v0.1.4
Published
[](https://www.npmjs.com/package/@aayank13/dir_manager) [](https://github.com/aayank13/dir_manager/blob/main/LICENSE)
Downloads
20
Readme
Directory Manager CLI
A CLI tool for managing directories and files efficiently. It allows you to:
- List directory contents with detailed filtering options.
- Create directories and files.
- Filter and search files by type, size, date, and regex.
Features
- List directory contents: View files and directories with detailed information, including size, creation date, and modification date.
- Create directories: Create new directories within the specified path.
- Create files: Quickly create empty files.
- Advanced Search and Filtering:
- Filter by file type (e.g.,
.txt,.js). - Filter by file size (e.g., minimum or maximum size).
- Filter by creation or modification date.
- Use regular expressions to search for filenames.
- Filter by file type (e.g.,
Installation
Install the CLI globally using npm:
npm install -g @aayank13/dir_managerUsage
Once installed, you can use the dirmanager command to manage directories and files.
Commands
List Directory Contents with Filtering
dirmanager --ls [path] [options]- path (optional): The directory to list. If omitted, it lists the current directory.
- Options:
--type <file-type>: Filter by file type (e.g.,.txt,.js).--min-size <size>: Minimum file size in bytes.--max-size <size>: Maximum file size in bytes.--start-date <date>: Filter files created or modified after a specific date (e.g.,2024-01-01).--end-date <date>: Filter files created or modified before a specific date.--regex <pattern>: Regex pattern for filenames.
Example:
dirmanager --ls ./my-folder --type .txt --min-size 1024 --start-date 2024-01-01Create a Directory
dirmanager --mkdir <directory-name>- directory-name: The name of the directory to create.
Example:
dirmanager --mkdir new-folderCreate a File
dirmanager --touch <file-name>- file-name: The name of the file to create.
Example:
dirmanager --touch new-file.txtDisplay Help
To display all available options:
dirmanager --helpExamples
List the contents of the current directory with filtering:
dirmanager --ls --type .txt --min-size 1024 --start-date 2024-01-01- Displays all
.txtfiles larger than 1KB modified after January 1st, 2024.
- Displays all
Create a new directory named
my-dir:dirmanager --mkdir my-dirCreate a new file named
example.txt:dirmanager --touch example.txt
Requirements
- Node.js v14 or higher.
Contributing
Feel free to fork the repository and submit a pull request with your improvements.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Author
Aayan
GitHub: @aayank13
NPM: @aayank13
Let me know if you'd like any further changes!