60

Tool for lazy developers

 5 years ago
source link: https://www.tuicool.com/articles/hit/rmqaA3J
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

jmIRFre.png!web

What is it?

As we use git frequently to manage our Web projects , it is common to make a mistake to mix npm commands with git e.g. we mistakenly type git install instead of npm install or git start instead of npm start etc.

Then here this tool comes to solve these issues: now you can run any npm command directly through git command e.g. run git install to install npm node modules or run git test to run test cases or even run git start to start the server , you don't need to switch from git to npm , JUST BE LAZY :sunglasses: .

Run npm commands through git

How does it work?

It just adds aliases for every npm commands to git and it doesn't affect the existing git commands, so you are good to go.

Installation

Install it from npm registry:

npm install -g git-plus-npm

Usage

After installing the tool, you are ready use npm commands through git:

Run git install instead of npm install

jEfERjV.png!web

Run git i instead of npm i

YR7jUfi.png!web

Run git test instead of npm test

NnQB3az.png!web

Run git start instead of npm start

JfmYj2r.png!web

Supported Commands

The following npm commands can be run through git :

  • access
  • adduser
  • audit
  • bin
  • bugs
  • cache
  • ci
  • cit
  • completion
  • create
  • ddp
  • dedupe
  • deprecate
  • dist-tag
  • docs
  • doctor
  • edit
  • explore
  • get
  • help-search
  • hook
  • isntall
  • install
  • install-test
  • it
  • link
  • list
  • ln
  • login
  • logout
  • ls
  • outdated
  • owner
  • pack
  • ping
  • prefix
  • profile
  • prune
  • publish
  • rb
  • rebuild
  • repo
  • restart
  • root
  • run
  • run-script
  • se
  • search
  • set
  • shrinkwrap
  • star
  • stars
  • start
  • stop
  • team
  • test
  • token
  • tst
  • un
  • uninstall
  • unlink
  • remove
  • unpublish
  • unstar
  • up
  • update
  • view
  • whoami

Contributing

Your PRs and stars are always welcome.

Checkout the CONTRIBUTING guides.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK