Created
July 31, 2016 13:49
-
-
Save halbgut/9bb78f4f81bac987b3aaf1087d6c986c to your computer and use it in GitHub Desktop.
A safer `npm install`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npmi () { | |
local packagename=$(echo ${@} | sed -E 's/(\-+[a-zA-Z0-9]+| )//g') | |
local opt | |
npm info ${packagename} | less | |
echo "Is it the right package? (y/n)" | |
read opt | |
if [[ "${opt}" == "y" ]]; then | |
npm i ${@} | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment