fmanager

cmd commands

Usage no npm install needed!

<script type="module">
  import fmanager from 'https://cdn.skypack.dev/fmanager';
</script>

README

fmanager

This is a command line application that will help you to manage files and folders using the cmd. With this tool you can be able to do a lot of files and folder manipulations like:

  1. creating a file
  2. creating a folder
  3. deleting a file
  4. deleting a folder
  5. renaming a file
  6. rename a folder
  7. etc

Installation

In order for you to use this package you need to install it globally as follows:

This package requires Node.js to be installed in your computer. And if you want to install it using yarn package manager you have to make sure that yarn is installed on your computer.

  1. using yarn
yarn global fmanager
  1. using npm
npm install -g fmanager

Usage

This is a command line application that is used to manipulate folders and files using the command line. You can run all the available commands which are listed bellow:

Available commands

  1. version

To check if the fmanager has been installed on your computer you should run the following command:

fmanager -v
# or
fmanager --version

Note that this command will give you the currently installed version of the fmanager package. You can get a specific version by installing it globally as follows:

npm i -g fmanager@<version>
# example
npm i -g fmanager@1.0.0
  1. creating a file
fmanager touch-file <filename>

# example
fmanager touch-file test.js

This will create a file called test.js in the current directory.

  1. creating a folder
fmanager touch-folder <foldername>

# example
fmanager touch-folder test

This will create a folder called test in the current directory.

  1. deleting a file
fmanager rm-file <foldername>

# example
fmanager rm-file test.py

This will delete a file called test.py in the current directory.

  1. deleting a folder
fmanager rm-folder <foldername>

# example
fmanager rm-folder test

This will delete a folder called test in the current directory.

  1. renaming a folder
fmanager rename-folder <old-foldername> <new-foldername>

# example
fmanager rename-folder test test1

This will renames a folder called test to test1 in the current directory.

  1. renaming a file
fmanager rename-file <old-filename> <new-filename>

# example
fmanager rename-file test.js test1.ts

This will renames a file called test.js to test1.ts in the current directory.

  1. Listing files and folders

To list files and folders in the current working directory we have two commands which are:

fmanager ls

# or

fmanager dir
  1. Opening a file

To open a file with a default program you need to run the following command:

fmanager open <filename>

# example
fmanager open index.ts

The above command will open the file index.ts with the default program.

make sure that the file exists in the current working directory.

  1. Moving file or folders

    Folders and files can be moved around teh file system by the fmanager using the following command:

fmanager move <filepath to be moved> <destination path>
#             (can be absolute)        (can be relative)

moving files/folders using relative path example:

fmanager move package.json .

moving files/folders using absolute path

fmanager move  C:\Users\user\OneDrive\Documents\npm\index.js C:\Users\user\OneDrive\Documents\backend\src
  1. copying files

To copy file is similar to the moving of a file or a folder except that this command onl copy files not folders using the following command:

fmanager copy-file <filepath to be moved> <destination path>
#             (can be absolute)        (can be relative)

Example:

fmanager copy-file  C:\Users\user\OneDrive\Documents\npm\index.js C:\Users\user\OneDrive\Documents\backend\src
  1. help

To get the docs or help from the fmanager you run the following command:

fmanager -h
# or
fmanager --help

Installing specific versions

Specific versions of fmanager can be installed globally by running the following command.

npm i -g fmanager@<version>

# example
npm i -g fmanager@2.0.0

The command:

npm i -g fmanager

Will install the latest version of fmanager.

Facing problems

If you are facing any problem using this tool feel free to create an issue so that we can improve our tool.

Still working on

In the versions that will come we are going to allow the creation of recursive files and folders for example creating files and folders using the following command:

# folders
fmanager touch-file test/unit/src
  • this will create a nested folders like:
- test
 - unit
    - src
# files
fmanager touch-file test/unit/src/user.test.js
  • this will create a nested folder and a file at the end like:
- test
 - unit
    - src
       - user.test.js