0.3.0 • Published 9 months ago

@gauravnumber/move v0.3.0

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

move

GitHub tag (latest SemVer) Twitter Follow

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/move

Usage

# 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.txt

Command:

move 1.txt 2.txt

Result:

.
ā”œā”€ā”€ 2_1.txt  # 1.txt was moved and renamed to avoid conflict
ā”œā”€ā”€ 2.txt
ā”œā”€ā”€ 3.txt
ā”œā”€ā”€ 4.txt
ā”œā”€ā”€ 5.txt
└── 6.txt

2. 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 file
  • move onefile twofile threefile andManyMoreFile directoryName - Move multiple files to a directory
  • move directory1 directory2 - Move a directory to another directory

How It Works

When a naming conflict occurs, move automatically:

  1. Detects the existing file/directory
  2. Appends an incremental index to the filename
  3. Ensures no data is lost during the move operation

License

MIT

0.3.0

9 months ago

0.2.4

1 year ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

4 years ago

0.2.0

4 years ago