GithubHelp home page GithubHelp logo

my-node-cli's Introduction

#my-node-cli
I experimented Node.js CLI by creating a CLI with three features:

  • Find the file's name in a directory that match the keyword and replace with a new one

  • Get size of a directory

  • Delete a directory

Installation

git clone https://github.com/tericcabrel/my-node-cli.git
cd my-node-cli
yarn
tsc
cd build
chmod +x index.js

After These steps, a directory named "build" will be created

Example

In the folder "node-project", replace all the file's name with the keyword "model" by a empty string. Only match js and ts file, case sensitive matter and apply the same rule .in sub folder

./index.js rename '/Users/john/Desktop/node-project' -c -r -o 'model' -n '' -m 'js,ts'

In the folder "node-project", replace in all the fine's name the keyword "model" by a empty string. Only exclude files with extension map and min.js file

./index.js rename '/Users/john/Desktop/node-project' -c -r -o 'model' -n '' -e 'map,min.js'

Delete node-project recursively

./index.js delete '/Users/john/Desktop/node-project' -r

Get the size of all zip file in the folder "node-project "recursively

./index.js size '/Users/john/Desktop/node-project' standard -r -m zip

Get the size of the folder "node-project" recursively but exclude zip and mp4 file

./index.js size '/Users/john/Desktop/node-project' -r -e zip,mp4

Get the size of the folder "node-project" recursively with commercial unit

./index.js size '/Users/john/Desktop/node-project' commercial -r

View available command:

./index.js --help

my-node-cli's People

Contributors

tericcabrel avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.