Just like anyone else, developers enjoy knowing some little tricks to show to their colleagues or friends. Today, I have decided to write about s...
For further actions, you may consider blocking this person and/or reporting abuse
Also,
npx
. 😎With the latest version of node, you can just do
npx mocha
instead of having to add./node_modules/.bin/
to yourPATH
.Nice - repo will come in handy I'm sure.
npm outdated
is another good one I use a lot! Gives you a table of installed and latest versions of your packages.And you can use
nom outdated -g
to see global packages.PS.: It's broken in some versions of NPM, so update your NPM.
Thanks for the list!
npm repo
andnpm home
was new to me and something I will use really often because if we are honest: no one bookmarks the docs of a package, we hit google and hope it is under the top results 😁glad to hear it will speed up your workflow!
The -S param is still needed for confuse and impress your colleagues
Many thanks for
repo
, TIL :)I'd add
ci
andoutdated
. ;)Oh, I didn't know about
npm version patch
andnpm t
. Very cool!I wonder if you can run other scripts when bumping the version of a package (like publishing it to npm automatically and generating the changelog)
I use np for publishing.
github.com/sindresorhus/np
Oh, this is a live saver! Thanks for sharing it :)
Thanks for your blog to teach us so many tricky things, May I ask how you make those pictures?
Thank you so much for your words, I use an online tool called carbon.now.sh/. You can use it to make cool code images and set the color, background etc.
Thanks man.
npx npkill is a great one to free up hard drive space. Searches your system for
node_modules
directories, displays their sizes, and allows you to quickly delete them.I found
npm set progress=false
to help me when usingnpm
.npm t
will be greatly welcomed to my npm vocabulary. Thanks!It’s literally ‘npm test’, in the same way as ‘npm start’.
Then there is
npm visnup
which does this
npm xmas
and
npm substack
(try running it multiple times)
npm repo <package>
is clutch.Great article! 👏 Didn't know about
npm run
, it's quite useful. I was doingcat package.json | grep "\"scripts\":" -A 8
😅alias t='npm t'
😎
npm i package -E
will save an exact version of the package
I'm impressed.
thank you so much for the appreciation! Hope this helped you to discover something new you will be able to apply!
Great resource, thanks!
Great post, thanks
useful!
I ran
npm ls --depth 0
and I got a lot of errors because missing dependencies 😂 🤣very helpfull.
Thanks Piero for sharing these wonderful commands