A while ago I started a thread on Twitter with a few terminal tips. There are lots of CLIs in NPM and they can be very handy in our daily work. Here they are and if you like them, follow me :)
1. list-scripts and npm-list-scripts give you a list of available npm script including what each script does. Useful for documentation:
— @leonardo@indieweb.social (@leozera) January 30, 2019
💻 npm i -g list-scripts npm-list-scripts
🌎 https://t.co/QvvFEpEMeQ https://t.co/6MFQXbHPLW#terminal #npm #cli #protip pic.twitter.com/84dwGqVviX
2. ncu checks the packages in your package.json file and gives you major and minor package updates info
— @leonardo@indieweb.social (@leozera) January 30, 2019
💻 npm i -g npm-check-updates
🌎 https://t.co/H9NIGetGKy#terminal #npm #cli #protip pic.twitter.com/EPmx3YKJwE
3. npm-scripts-tree is helpful when you have scripts calling other scripts and you are lost trying to understand the dependencies between them. Really handy for documentation:
— @leonardo@indieweb.social (@leozera) January 30, 2019
💻 npm i -g npm-scripts-tree
🌎 https://t.co/4NVKocfDuY#terminal #npm #cli #protip pic.twitter.com/7NWn2FBPBK
4. space-hogs shows large directories - imagine a better du:
— @leonardo@indieweb.social (@leozera) January 30, 2019
💻 npm i -g space-hogs
🌎 https://t.co/xPlGzYjLJk#terminal #npm #cli #protip pic.twitter.com/HKZQP9NMgq
5. see is an improved cat (aka syntax highlight)
— @leonardo@indieweb.social (@leozera) January 30, 2019
💻 npm i -g see-cli
🌎 https://t.co/bEAjBJjhGt#terminal #npm #cli #protip pic.twitter.com/o6rx8MZbel
6. colorls is a ruby script that changes the ls output with color and icons
— @leonardo@indieweb.social (@leozera) January 30, 2019
💻 gem install colorls
🌎 https://t.co/9F3n6v3FnA#terminal #ruby #cli #protip pic.twitter.com/NF675JfdPx
7. You can use repeat in zsh and the speed-test cli from @sindresorhus to keep monitoring your internet speed
— @leonardo@indieweb.social (@leozera) January 30, 2019
💻 repeat 10000 { date +"%T"; speed-test; sleep 1 }
🌎 https://t.co/BP4Rj4qI5r pic.twitter.com/22j1YV6Kf1
8. You can configure git to push to the current branch:
— @leonardo@indieweb.social (@leozera) February 8, 2019
git config --global push.default current
So instead of:
git push origin your-feature-branch
You can just do:
git push #protip #terminal #git
9. Writing a PR? Maybe you want a list of your commits:
— @leonardo@indieweb.social (@leozera) October 5, 2019
git log origin/master..HEAD --no-merges --pretty=format:'- %s' --reverse#protip #terminal #git @github pic.twitter.com/od8e8LPpPa
10. Running out of space? Maybe too many node_modules folders:
— @leonardo@indieweb.social (@leozera) January 9, 2020
💻 npx npkill
🌎 https://t.co/zyj9s6eCj9
Saved 10GB+ here ~ #terminal #npm #cli #protip pic.twitter.com/y31i7gS9af