Skip to content

Instantly share code, notes, and snippets.

@nicdoye
Created February 29, 2016 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicdoye/7549383d0f86a0a7c7af to your computer and use it in GitHub Desktop.
Save nicdoye/7549383d0f86a0a7c7af to your computer and use it in GitHub Desktop.
Install and find all the node modules
# Assuming you only require from index.js
# and you use const
# and you use const at the beginning of a line
# and there aren't other things like child_process to filter out
npm install $(egrep ^'const(.*)= require' index.js | egrep -v '/|child_process' | cut -f2 -d\' | xargs)
@nicdoye
Copy link
Author

nicdoye commented Feb 29, 2016

I can bet Node has a better, built in way. Embarrass/educate me by putting a link in here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment