nshm

1.3.0 • Public • Published

nshm ( Node.js .sh Scripts Manager )

init your working directory with common useful .sh files

[中文版]

 
$ npm install nshm -g
 
$ nshm <command> [args...]
 

add a command

 
$ nshm add <command_name> -[t|f] [text|path]
 

example

 
# add file content 
$ nshm add commit --file ./my-commit.sh
# or 
$ nshm add commit -f ./my-commit.sh
 
# add text content 
$ nshm add pull --text "git pull"
# or 
$ nshm add pull -t "git pull"
 

combine current commands into one

 
$ nshm co <command_name> [command|text] [command|text] [command|text] [...]
 

example

 
$ nshm co git commit pull "git status"
 

remove existing command(s)

 
$ nshm rm <command_name> <command_name> <...> 
 

example

 
$ nshm rm commit pull git
 

remove all existing commands

 
$ nshm clean
 

list all existing commands

 
# view all names 
$ nshm ls
 
# view all details 
$ nshm ls -a
 

get version number

 
$ nshm -v
$ nshm --version
 

Demo-1

 
$ nshm add add -t "git add -A"
$ nshm add commit -t "git commit -m 'push'"
$ nshm add pull -t "git push"
 
 
$ nshm co git add commit pull
 
# init my directory 
# then we'll get `add.sh` `commit.sh` `pull.sh` 
$ nshm git 
 

Demo-2

 
# browserSync cli  
# here we use `${}` as placeholders 
# for necessary params 
$ nshm add bs -t "browser-sync start --server --files \"${files}\" --index \"${index}\" --open \"external\" --reload-debounce --no-notify"
 
# init my directory and get the `bs.sh` 
$ nshm bs --file '**' --index 'index.html'
 

Readme

Keywords

none

Package Sidebar

Install

npm i nshm

Weekly Downloads

0

Version

1.3.0

License

MIT

Last publish

Collaborators

  • yywl