The documentation currently just says 'avoid typos'.
siddharthkp: please give me a way to contact you. see my contact info on my profile.
So their security model is basically the same as with C: "do it perfectly the first time."
https://news.ycombinator.com/user?id=siddharthkp doesn't return an email address, and I don't see one on the GitHub profile page either.
With this, you have to be careful the WHOLE time you are typing. You normally don't worry about hitting return in your editor causing RCE.
Opened an issue here: https://github.com/siddharthkp/auto-install/issues/2
(defun install-from-npm-region (start end)
(interactive "r")
(call-process
(concat "npm install "
(shell-quote-argument
(filter-buffer-substring start end)))
nil
(get-buffer-create "*NPM Output*")))
That function MIGHT install random things through NPM if your mark is unset, but it is, at least, explicit. And the random thing in question is your last region, so it's far more likely that NPM will just throw its hands and shout "what the hell?" Than actually install anthing...Also note that that code hasn't been tested. I wouldn't copy this into my .emacs just yet, if I were you. Run it by somebody who actually knows elisp, first.
One other possibility is to have a delay, so that it waits an amount of time before installing, to give a chance to catch and fix the typo.