0.3.0 ⢠Published 9 months ago
@gauravnumber/move v0.3.0
move
A Node.js utility that enhances file and directory moving capabilities with smart conflict resolution. Unlike the standard mv command, move automatically handles naming conflicts by appending indices to filenames.
Features
- š Zero dependencies
- š¦ Simple installation
- š Smart conflict resolution
- š Supports both files and directories
- š¢ Handles multiple sources
- ā” Fast and efficient
Installation
npm install -g @gauravnumber/moveUsage
# Basic usage
move <source_path> <destination_path>
# Move multiple files to a directory
move <file1> <file2> ... <directory>Examples
1. Moving a Single File
Initial structure:
.
āāā 1.txt
āāā 2.txt
āāā 3.txt
āāā 4.txt
āāā 5.txt
āāā 6.txtCommand:
move 1.txt 2.txtResult:
.
āāā 2_1.txt # 1.txt was moved and renamed to avoid conflict
āāā 2.txt
āāā 3.txt
āāā 4.txt
āāā 5.txt
āāā 6.txt2. Moving Multiple Files
Command:
move 1.txt 2.txt 3.txt destination_folder/3. Moving Directories
Command:
move source_directory/ destination_directory/Supported Operations
move filename1 filename2- Move/rename a single filemove onefile twofile threefile andManyMoreFile directoryName- Move multiple files to a directorymove directory1 directory2- Move a directory to another directory
How It Works
When a naming conflict occurs, move automatically:
- Detects the existing file/directory
- Appends an incremental index to the filename
- Ensures no data is lost during the move operation
License
MIT