Skip to content

Instantly share code, notes, and snippets.

@johnrees
Forked from mafintosh/bashrc.sh
Created May 29, 2018 12:48
Show Gist options
  • Save johnrees/d63980817992053d145c205f359adbd3 to your computer and use it in GitHub Desktop.
Save johnrees/d63980817992053d145c205f359adbd3 to your computer and use it in GitHub Desktop.
// by @noffle
autoinstall () {
local MODULES=$(cat $1 | grep "require('.*')" | sed "s/.*require('\(.*\)')/\1/" | grep -v '^\.' | tr '\n' ' ')
shift
shift
npm install $MODULES $@
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment