Skip to content

Instantly share code, notes, and snippets.

@jkintscher
Created August 6, 2013 21:13
Show Gist options
  • Select an option

  • Save jkintscher/6168694 to your computer and use it in GitHub Desktop.

Select an option

Save jkintscher/6168694 to your computer and use it in GitHub Desktop.
require 'json'
json = File.read('package.json')
dependencies = JSON.parse(json)
cmd = ''
dependencies['devDependencies'].each do |dependency|
version = dependency[1].gsub(/[\~]/, '')
cmd += 'npm install ' + dependency[0] + '@' + version + "\n"
end
system(cmd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment