mvy

0.2.1 • Public • Published

mvy NPM version

mvy = mkdirp + mv // a cli for moving to a new directory

Installation

$ npm install mvy --global

Usage

$ mvy <source> ... <target>

    Options

      --force, -f  Overwrite existing target files
# MAJOR KEY ALERT:
#
# 1. When the <target> has a trailing slash,
#    the <source> will be placed inside the <target>
#
# 2. When both the <source> and <target> have trailing slashes,
#    the *ENTIRE* <source> path will be appended to the <target> path
#    and the <source> files will be placed inside the appended <target> path
#
# 3. Supports multiple sources and globs


# move a file into a new directory
$ mvy somewhere/exists/a.file yet/to/be/created/directory/
# => yet/to/be/created/directory/a.file


# move multiple files into a new directory
$ mvy somewhere/exists/*.file yet/to/be/created/directory/
# => yet/to/be/created/directory/a.file
# => yet/to/be/created/directory/b.file


# move a file into a new directory and rename the file
$ mvy somewhere/exists/a.file yet/to/be/created/directory/b.file
# => yet/to/be/created/directory/b.file


# move a directory into a new directory
$ mvy somewhere/exists yet/to/be/created/directory/
# => yet/to/be/created/directory/exists/
# => yet/to/be/created/directory/exists/a.file


# move a directory into a new directory and rename the directory
$ mvy somewhere/exists yet/to/be/created/directory
# => yet/to/be/created/directory/
# => yet/to/be/created/directory/a.file


# move a directory into a new directory *APPENDING THE SOURCE PATH*
$ mvy somewhere/exists/ yet/to/be/created/directory/
# => yet/to/be/created/directory/somewhere/exists/
# => yet/to/be/created/directory/somewhere/exists/a.file

License

ISC © Buster Collings

Package Sidebar

Install

npm i mvy

Weekly Downloads

6

Version

0.2.1

License

ISC

Unpacked Size

4.26 kB

Total Files

4

Last publish

Collaborators

  • buster